{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Network Visualization\n",
    "\n",
    "This notebook loads a dataset and network and visualized the dataset features and subsequent network activations"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "import os\n",
    "import tensorflow as tf\n",
    "from Dataset import Dataset\n",
    "import matplotlib.pyplot as plt\n",
    "# custom functions for interactiva plotting\n",
    "from utils.interactive_plotting import show, show_gray, show_rgb\n",
    "# custom functions for writing pngs\n",
    "from utils.interactive_plotting import norm_ptp, norm_std, norm_rgb, write, dump3, dump, dump_rgb, dump_class\n",
    "import numpy as np\n",
    "from PIL import Image\n",
    "%matplotlib inline\n",
    "\n",
    "tf.reset_default_graph()\n",
    "\n",
    "modeldir=\"data_IJGI18/models/convlstm256_48px\"\n",
    "\n",
    "# None -> dont write output pngs\n",
    "outfolder=None\n",
    "\n",
    "datadir=\"data_IJGI18/datasets/demo/480\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Initialize Dataset\n",
    "\n",
    "If `RessourceExhaustedError` or `OutOfMemory` error occur later: reduce number ids in `overwrite_ids` and `batchsize`"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "overwriting data ids! due to manual input\n",
      "dataset: 2016, partition: eval, fold:0 2/1944 tiles downloaded (0.10 %)\n"
     ]
    }
   ],
   "source": [
    "# set specificly which ids should be returned (set none for random)\n",
    "# tile ids from paper: 1823 8133 2550 2554 10791 10792 10879 10969 12894 16494 1272\n",
    "overwrite_ids=[2550,10969]\n",
    "batchsize=2\n",
    "\n",
    "dataset = Dataset(datadir=datadir, \n",
    "                  verbose=True, \n",
    "                  temporal_samples=None, \n",
    "                  section=\"2016\")\n",
    "\n",
    "tfdataset, _, _, filenames = dataset.create_tf_dataset(\"eval\",0,batchsize,True,2,overwrite_ids=overwrite_ids)\n",
    "iterator = tfdataset.make_initializable_iterator()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Start TF Session and initialize iterators"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[None]"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "config = tf.ConfigProto()\n",
    "sess = tf.InteractiveSession()\n",
    "\n",
    "data_handle = sess.run(iterator.string_handle())\n",
    "\n",
    "#train_writer = tf.summary.FileWriter(os.path.join(args.modeldir, TRAINING_SUMMARY_FOLDER_NAME), sess.graph)\n",
    "#test_writer = tf.summary.FileWriter(os.path.join(args.modeldir, TESTING_SUMMARY_FOLDER_NAME))\n",
    "\n",
    "sess.run([iterator.initializer])"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Checkout input data from the iterator"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "sess.run([tf.global_variables_initializer(), tf.local_variables_initializer(), tf.tables_initializer()])\n",
    "\n",
    "# run a network session with the operations defined prviously\n",
    "x10,x20,x60,doy,year,labels = sess.run(iterator.get_next())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "87b8210b1d264bab95bc48942fade5ee",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "A Jupyter Widget"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "cfea4a6c75434ea6978514e578dc8769",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "A Jupyter Widget"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "1704d6b4a3c548deb4a40a434882ecc0",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "A Jupyter Widget"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "d3d8de15710c41b1869d668a2c2dff15",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "A Jupyter Widget"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "show_rgb(x10)\n",
    "show_rgb(x20)\n",
    "show_rgb(x60)\n",
    "show_gray(labels[:,0,:,:],name=\"labels\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## load model graph definition (graph.meta)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[None, None]"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "graph=os.path.join(modeldir,\"graph.meta\")\n",
    "tf.train.import_meta_graph(graph)\n",
    "\n",
    "# initialize variables\n",
    "sess.run([tf.global_variables_initializer(), tf.local_variables_initializer()])"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## restore weights from checkpoint (model.ckpt)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "restoring from data_IJGI18/models/convlstm256_48px/model.ckpt-131650\n",
      "INFO:tensorflow:Restoring parameters from data_IJGI18/models/convlstm256_48px/model.ckpt-131650\n"
     ]
    }
   ],
   "source": [
    "saver = tf.train.Saver(save_relative_paths=True)\n",
    "checkpoint = os.path.join(modeldir, \"model.ckpt\")\n",
    "\n",
    "latest_ckpt = tf.train.latest_checkpoint(modeldir)\n",
    "if latest_ckpt is not None:\n",
    "    print \"restoring from \" + latest_ckpt\n",
    "    saver.restore(sess, latest_ckpt)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## List of all available operations within the model graph"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[<tf.Operation 'Const' type=Const>,\n",
       " <tf.Operation 'Const_1' type=Const>,\n",
       " <tf.Operation 'hash_table' type=HashTableV2>,\n",
       " <tf.Operation 'hash_table/Const' type=Const>,\n",
       " <tf.Operation 'key_value_init' type=InitializeTableV2>,\n",
       " <tf.Operation 'hash_table_1' type=HashTableV2>,\n",
       " <tf.Operation 'hash_table_1/Const' type=Const>,\n",
       " <tf.Operation 'key_value_init_1' type=InitializeTableV2>,\n",
       " <tf.Operation 'RandomShuffle/value' type=Const>,\n",
       " <tf.Operation 'RandomShuffle' type=RandomShuffle>,\n",
       " <tf.Operation 'compression_type' type=Const>,\n",
       " <tf.Operation 'buffer_size' type=Const>,\n",
       " <tf.Operation 'num_parallel_calls' type=Const>,\n",
       " <tf.Operation 'count' type=Const>,\n",
       " <tf.Operation 'Const_2' type=Const>,\n",
       " <tf.Operation 'Iterator' type=Iterator>,\n",
       " <tf.Operation 'TFRecordDataset' type=TFRecordDataset>,\n",
       " <tf.Operation 'ParallelMapDataset' type=ParallelMapDataset>,\n",
       " <tf.Operation 'RepeatDataset' type=RepeatDataset>,\n",
       " <tf.Operation 'BatchDataset/batch_size' type=Const>,\n",
       " <tf.Operation 'BatchDataset' type=BatchDataset>,\n",
       " <tf.Operation 'PrefetchDataset' type=PrefetchDataset>,\n",
       " <tf.Operation 'MakeIterator' type=MakeIterator>,\n",
       " <tf.Operation 'IteratorToStringHandle' type=IteratorToStringHandle>,\n",
       " <tf.Operation 'init' type=NoOp>,\n",
       " <tf.Operation 'init_1' type=NoOp>,\n",
       " <tf.Operation 'init_all_tables' type=NoOp>,\n",
       " <tf.Operation 'IteratorGetNext' type=IteratorGetNext>,\n",
       " <tf.Operation 'data_iterator_handle' type=Placeholder>,\n",
       " <tf.Operation 'Cast/x' type=Const>,\n",
       " <tf.Operation 'is_train' type=PlaceholderWithDefault>,\n",
       " <tf.Operation 'input/IteratorFromStringHandle' type=IteratorFromStringHandle>,\n",
       " <tf.Operation 'input/raw/IteratorGetNext' type=IteratorGetNext>,\n",
       " <tf.Operation 'input/raw/y' type=Cast>,\n",
       " <tf.Operation 'input/strided_slice/stack' type=Const>,\n",
       " <tf.Operation 'input/strided_slice/stack_1' type=Const>,\n",
       " <tf.Operation 'input/strided_slice/stack_2' type=Const>,\n",
       " <tf.Operation 'input/strided_slice' type=StridedSlice>,\n",
       " <tf.Operation 'input/Greater/y' type=Const>,\n",
       " <tf.Operation 'input/Greater' type=Greater>,\n",
       " <tf.Operation 'input/Cast' type=Cast>,\n",
       " <tf.Operation 'input/sequence_lengths/reduction_indices' type=Const>,\n",
       " <tf.Operation 'input/sequence_lengths' type=Sum>,\n",
       " <tf.Operation 'input/reshaped/Shape' type=Shape>,\n",
       " <tf.Operation 'input/reshaped/strided_slice/stack' type=Const>,\n",
       " <tf.Operation 'input/reshaped/strided_slice/stack_1' type=Const>,\n",
       " <tf.Operation 'input/reshaped/strided_slice/stack_2' type=Const>,\n",
       " <tf.Operation 'input/reshaped/strided_slice' type=StridedSlice>,\n",
       " <tf.Operation 'input/reshaped/Shape_1' type=Shape>,\n",
       " <tf.Operation 'input/reshaped/strided_slice_1/stack' type=Const>,\n",
       " <tf.Operation 'input/reshaped/strided_slice_1/stack_1' type=Const>,\n",
       " <tf.Operation 'input/reshaped/strided_slice_1/stack_2' type=Const>,\n",
       " <tf.Operation 'input/reshaped/strided_slice_1' type=StridedSlice>,\n",
       " <tf.Operation 'input/reshaped/Shape_2' type=Shape>,\n",
       " <tf.Operation 'input/reshaped/strided_slice_2/stack' type=Const>,\n",
       " <tf.Operation 'input/reshaped/strided_slice_2/stack_1' type=Const>,\n",
       " <tf.Operation 'input/reshaped/strided_slice_2/stack_2' type=Const>,\n",
       " <tf.Operation 'input/reshaped/strided_slice_2' type=StridedSlice>,\n",
       " <tf.Operation 'input/reshaped/Shape_3' type=Shape>,\n",
       " <tf.Operation 'input/reshaped/strided_slice_3/stack' type=Const>,\n",
       " <tf.Operation 'input/reshaped/strided_slice_3/stack_1' type=Const>,\n",
       " <tf.Operation 'input/reshaped/strided_slice_3/stack_2' type=Const>,\n",
       " <tf.Operation 'input/reshaped/strided_slice_3' type=StridedSlice>,\n",
       " <tf.Operation 'input/reshaped/Shape_4' type=Shape>,\n",
       " <tf.Operation 'input/reshaped/strided_slice_4/stack' type=Const>,\n",
       " <tf.Operation 'input/reshaped/strided_slice_4/stack_1' type=Const>,\n",
       " <tf.Operation 'input/reshaped/strided_slice_4/stack_2' type=Const>,\n",
       " <tf.Operation 'input/reshaped/strided_slice_4' type=StridedSlice>,\n",
       " <tf.Operation 'input/reshaped/Shape_5' type=Shape>,\n",
       " <tf.Operation 'input/reshaped/strided_slice_5/stack' type=Const>,\n",
       " <tf.Operation 'input/reshaped/strided_slice_5/stack_1' type=Const>,\n",
       " <tf.Operation 'input/reshaped/strided_slice_5/stack_2' type=Const>,\n",
       " <tf.Operation 'input/reshaped/strided_slice_5' type=StridedSlice>,\n",
       " <tf.Operation 'input/reshaped/Shape_6' type=Shape>,\n",
       " <tf.Operation 'input/reshaped/strided_slice_6/stack' type=Const>,\n",
       " <tf.Operation 'input/reshaped/strided_slice_6/stack_1' type=Const>,\n",
       " <tf.Operation 'input/reshaped/strided_slice_6/stack_2' type=Const>,\n",
       " <tf.Operation 'input/reshaped/strided_slice_6' type=StridedSlice>,\n",
       " <tf.Operation 'input/reshaped/Shape_7' type=Shape>,\n",
       " <tf.Operation 'input/reshaped/strided_slice_7/stack' type=Const>,\n",
       " <tf.Operation 'input/reshaped/strided_slice_7/stack_1' type=Const>,\n",
       " <tf.Operation 'input/reshaped/strided_slice_7/stack_2' type=Const>,\n",
       " <tf.Operation 'input/reshaped/strided_slice_7' type=StridedSlice>,\n",
       " <tf.Operation 'input/reshaped/mul' type=Mul>,\n",
       " <tf.Operation 'input/reshaped/Reshape/shape' type=Pack>,\n",
       " <tf.Operation 'input/reshaped/Reshape' type=Reshape>,\n",
       " <tf.Operation 'input/reshaped/size' type=Pack>,\n",
       " <tf.Operation 'input/reshaped/ResizeBilinear' type=ResizeBilinear>,\n",
       " <tf.Operation 'input/reshaped/Reshape_1/shape' type=Pack>,\n",
       " <tf.Operation 'input/reshaped/Reshape_1' type=Reshape>,\n",
       " <tf.Operation 'input/reshaped/x20' type=Identity>,\n",
       " <tf.Operation 'input/reshaped/Shape_8' type=Shape>,\n",
       " <tf.Operation 'input/reshaped/strided_slice_8/stack' type=Const>,\n",
       " <tf.Operation 'input/reshaped/strided_slice_8/stack_1' type=Const>,\n",
       " <tf.Operation 'input/reshaped/strided_slice_8/stack_2' type=Const>,\n",
       " <tf.Operation 'input/reshaped/strided_slice_8' type=StridedSlice>,\n",
       " <tf.Operation 'input/reshaped/Shape_9' type=Shape>,\n",
       " <tf.Operation 'input/reshaped/strided_slice_9/stack' type=Const>,\n",
       " <tf.Operation 'input/reshaped/strided_slice_9/stack_1' type=Const>,\n",
       " <tf.Operation 'input/reshaped/strided_slice_9/stack_2' type=Const>,\n",
       " <tf.Operation 'input/reshaped/strided_slice_9' type=StridedSlice>,\n",
       " <tf.Operation 'input/reshaped/Shape_10' type=Shape>,\n",
       " <tf.Operation 'input/reshaped/strided_slice_10/stack' type=Const>,\n",
       " <tf.Operation 'input/reshaped/strided_slice_10/stack_1' type=Const>,\n",
       " <tf.Operation 'input/reshaped/strided_slice_10/stack_2' type=Const>,\n",
       " <tf.Operation 'input/reshaped/strided_slice_10' type=StridedSlice>,\n",
       " <tf.Operation 'input/reshaped/Shape_11' type=Shape>,\n",
       " <tf.Operation 'input/reshaped/strided_slice_11/stack' type=Const>,\n",
       " <tf.Operation 'input/reshaped/strided_slice_11/stack_1' type=Const>,\n",
       " <tf.Operation 'input/reshaped/strided_slice_11/stack_2' type=Const>,\n",
       " <tf.Operation 'input/reshaped/strided_slice_11' type=StridedSlice>,\n",
       " <tf.Operation 'input/reshaped/Shape_12' type=Shape>,\n",
       " <tf.Operation 'input/reshaped/strided_slice_12/stack' type=Const>,\n",
       " <tf.Operation 'input/reshaped/strided_slice_12/stack_1' type=Const>,\n",
       " <tf.Operation 'input/reshaped/strided_slice_12/stack_2' type=Const>,\n",
       " <tf.Operation 'input/reshaped/strided_slice_12' type=StridedSlice>,\n",
       " <tf.Operation 'input/reshaped/mul_1' type=Mul>,\n",
       " <tf.Operation 'input/reshaped/Reshape_2/shape' type=Pack>,\n",
       " <tf.Operation 'input/reshaped/Reshape_2' type=Reshape>,\n",
       " <tf.Operation 'input/reshaped/size_1' type=Pack>,\n",
       " <tf.Operation 'input/reshaped/ResizeBilinear_1' type=ResizeBilinear>,\n",
       " <tf.Operation 'input/reshaped/Reshape_3/shape' type=Pack>,\n",
       " <tf.Operation 'input/reshaped/Reshape_3' type=Reshape>,\n",
       " <tf.Operation 'input/reshaped/x60' type=Identity>,\n",
       " <tf.Operation 'input/reshaped/x10' type=Identity>,\n",
       " <tf.Operation 'input/reshaped/ExpandDims/dim' type=Const>,\n",
       " <tf.Operation 'input/reshaped/ExpandDims' type=ExpandDims>,\n",
       " <tf.Operation 'input/reshaped/ExpandDims_1/dim' type=Const>,\n",
       " <tf.Operation 'input/reshaped/ExpandDims_1' type=ExpandDims>,\n",
       " <tf.Operation 'input/reshaped/ExpandDims_2/dim' type=Const>,\n",
       " <tf.Operation 'input/reshaped/ExpandDims_2' type=ExpandDims>,\n",
       " <tf.Operation 'input/reshaped/ones/shape/4' type=Const>,\n",
       " <tf.Operation 'input/reshaped/ones/shape' type=Pack>,\n",
       " <tf.Operation 'input/reshaped/ones/Const' type=Const>,\n",
       " <tf.Operation 'input/reshaped/ones' type=Fill>,\n",
       " <tf.Operation 'input/reshaped/doy' type=Mul>,\n",
       " <tf.Operation 'input/reshaped/ExpandDims_3/dim' type=Const>,\n",
       " <tf.Operation 'input/reshaped/ExpandDims_3' type=ExpandDims>,\n",
       " <tf.Operation 'input/reshaped/ExpandDims_4/dim' type=Const>,\n",
       " <tf.Operation 'input/reshaped/ExpandDims_4' type=ExpandDims>,\n",
       " <tf.Operation 'input/reshaped/ExpandDims_5/dim' type=Const>,\n",
       " <tf.Operation 'input/reshaped/ExpandDims_5' type=ExpandDims>,\n",
       " <tf.Operation 'input/reshaped/ones_1/shape/4' type=Const>,\n",
       " <tf.Operation 'input/reshaped/ones_1/shape' type=Pack>,\n",
       " <tf.Operation 'input/reshaped/ones_1/Const' type=Const>,\n",
       " <tf.Operation 'input/reshaped/ones_1' type=Fill>,\n",
       " <tf.Operation 'input/reshaped/year' type=Mul>,\n",
       " <tf.Operation 'input/reshaped/x/axis' type=Const>,\n",
       " <tf.Operation 'input/reshaped/x' type=ConcatV2>,\n",
       " <tf.Operation 'convrnn1/input' type=Identity>,\n",
       " <tf.Operation 'convrnn1/DropoutWrapperInit/Const' type=Const>,\n",
       " <tf.Operation 'convrnn1/DropoutWrapperInit/Const_1' type=Const>,\n",
       " <tf.Operation 'convrnn1/DropoutWrapperInit/Const_2' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/Rank' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/range/start' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/range/delta' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/range' type=Range>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/concat/values_0' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/concat/axis' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/concat' type=ConcatV2>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/transpose' type=Transpose>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/sequence_length' type=Identity>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/Shape' type=Shape>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/strided_slice/stack' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/strided_slice/stack_1' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/strided_slice/stack_2' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/strided_slice' type=StridedSlice>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/DropoutWrapperZeroState/ConvLSTMCellZeroState/ExpandDims/dim' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/DropoutWrapperZeroState/ConvLSTMCellZeroState/ExpandDims' type=ExpandDims>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/DropoutWrapperZeroState/ConvLSTMCellZeroState/Const' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/DropoutWrapperZeroState/ConvLSTMCellZeroState/concat/axis' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/DropoutWrapperZeroState/ConvLSTMCellZeroState/concat' type=ConcatV2>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/DropoutWrapperZeroState/ConvLSTMCellZeroState/zeros/Const' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/DropoutWrapperZeroState/ConvLSTMCellZeroState/zeros' type=Fill>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/DropoutWrapperZeroState/ConvLSTMCellZeroState/ExpandDims_1/dim' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/DropoutWrapperZeroState/ConvLSTMCellZeroState/ExpandDims_1' type=ExpandDims>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/DropoutWrapperZeroState/ConvLSTMCellZeroState/Const_1' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/DropoutWrapperZeroState/ConvLSTMCellZeroState/ExpandDims_2/dim' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/DropoutWrapperZeroState/ConvLSTMCellZeroState/ExpandDims_2' type=ExpandDims>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/DropoutWrapperZeroState/ConvLSTMCellZeroState/Const_2' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/DropoutWrapperZeroState/ConvLSTMCellZeroState/concat_1/axis' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/DropoutWrapperZeroState/ConvLSTMCellZeroState/concat_1' type=ConcatV2>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/DropoutWrapperZeroState/ConvLSTMCellZeroState/zeros_1/Const' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/DropoutWrapperZeroState/ConvLSTMCellZeroState/zeros_1' type=Fill>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/DropoutWrapperZeroState/ConvLSTMCellZeroState/ExpandDims_3/dim' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/DropoutWrapperZeroState/ConvLSTMCellZeroState/ExpandDims_3' type=ExpandDims>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/DropoutWrapperZeroState/ConvLSTMCellZeroState/Const_3' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/Shape_1' type=Shape>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/stack' type=Pack>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/Equal' type=Equal>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/Const' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/All' type=All>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/Assert/Const' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/Assert/Const_1' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/Assert/Assert/data_0' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/Assert/Assert/data_2' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/Assert/Assert' type=Assert>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/CheckSeqLen' type=Identity>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/Shape_2' type=Shape>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/strided_slice_1/stack' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/strided_slice_1/stack_1' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/strided_slice_1/stack_2' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/strided_slice_1' type=StridedSlice>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/Shape_3' type=Shape>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/strided_slice_2/stack' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/strided_slice_2/stack_1' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/strided_slice_2/stack_2' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/strided_slice_2' type=StridedSlice>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/ExpandDims/dim' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/ExpandDims' type=ExpandDims>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/Const_1' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/concat/axis' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/concat' type=ConcatV2>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/zeros/Const' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/zeros' type=Fill>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/Rank' type=Rank>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/range/start' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/range/delta' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/range' type=Range>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/Min' type=Min>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/Rank_1' type=Rank>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/range_1/start' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/range_1/delta' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/range_1' type=Range>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/Max' type=Max>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/time' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/TensorArray' type=TensorArrayV3>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/TensorArray_1' type=TensorArrayV3>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/TensorArrayUnstack/Shape' type=Shape>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/TensorArrayUnstack/strided_slice/stack' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/TensorArrayUnstack/strided_slice/stack_1' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/TensorArrayUnstack/strided_slice/stack_2' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/TensorArrayUnstack/strided_slice' type=StridedSlice>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/TensorArrayUnstack/range/start' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/TensorArrayUnstack/range/delta' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/TensorArrayUnstack/range' type=Range>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/TensorArrayUnstack/TensorArrayScatter/TensorArrayScatterV3' type=TensorArrayScatterV3>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/Enter' type=Enter>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/Enter_1' type=Enter>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/Enter_2' type=Enter>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/Enter_3' type=Enter>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/Merge' type=Merge>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/Merge_1' type=Merge>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/Merge_2' type=Merge>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/Merge_3' type=Merge>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/Less/Enter' type=Enter>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/Less' type=Less>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/LoopCond' type=LoopCond>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/Switch' type=Switch>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/Switch_1' type=Switch>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/Switch_2' type=Switch>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/Switch_3' type=Switch>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/Identity' type=Identity>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/Identity_1' type=Identity>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/Identity_2' type=Identity>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/Identity_3' type=Identity>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/TensorArrayReadV3/Enter' type=Enter>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/TensorArrayReadV3/Enter_1' type=Enter>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/TensorArrayReadV3' type=TensorArrayReadV3>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/concat/axis' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/concat' type=ConcatV2>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/conv_lstm_cell/kernel/Initializer/random_uniform/shape' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/conv_lstm_cell/kernel/Initializer/random_uniform/min' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/conv_lstm_cell/kernel/Initializer/random_uniform/max' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/conv_lstm_cell/kernel/Initializer/random_uniform/RandomUniform' type=RandomUniform>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/conv_lstm_cell/kernel/Initializer/random_uniform/sub' type=Sub>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/conv_lstm_cell/kernel/Initializer/random_uniform/mul' type=Mul>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/conv_lstm_cell/kernel/Initializer/random_uniform' type=Add>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/conv_lstm_cell/kernel' type=VariableV2>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/conv_lstm_cell/kernel/Assign' type=Assign>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/conv_lstm_cell/kernel/read' type=Identity>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/Const' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/MirrorPad' type=MirrorPad>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/convolution/dilation_rate' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/convolution/Enter' type=Enter>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/convolution' type=Conv2D>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/Const_1' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/split/split_dim' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/split' type=Split>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/conv_lstm_cell/LayerNorm/beta/Initializer/zeros' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/conv_lstm_cell/LayerNorm/beta' type=VariableV2>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/conv_lstm_cell/LayerNorm/beta/Assign' type=Assign>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/conv_lstm_cell/LayerNorm/beta/read' type=Identity>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/conv_lstm_cell/LayerNorm/gamma/Initializer/ones' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/conv_lstm_cell/LayerNorm/gamma' type=VariableV2>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/conv_lstm_cell/LayerNorm/gamma/Assign' type=Assign>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/conv_lstm_cell/LayerNorm/gamma/read' type=Identity>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm/moments/mean/reduction_indices' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm/moments/mean' type=Mean>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm/moments/StopGradient' type=StopGradient>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm/moments/SquaredDifference' type=SquaredDifference>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm/moments/variance/reduction_indices' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm/moments/variance' type=Mean>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm/batchnorm/add/y' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm/batchnorm/add' type=Add>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm/batchnorm/Rsqrt' type=Rsqrt>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm/batchnorm/mul/Enter' type=Enter>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm/batchnorm/mul' type=Mul>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm/batchnorm/mul_1' type=Mul>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm/batchnorm/mul_2' type=Mul>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm/batchnorm/sub/Enter' type=Enter>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm/batchnorm/sub' type=Sub>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm/batchnorm/add_1' type=Add>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/conv_lstm_cell/LayerNorm_1/beta/Initializer/zeros' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/conv_lstm_cell/LayerNorm_1/beta' type=VariableV2>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/conv_lstm_cell/LayerNorm_1/beta/Assign' type=Assign>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/conv_lstm_cell/LayerNorm_1/beta/read' type=Identity>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/conv_lstm_cell/LayerNorm_1/gamma/Initializer/ones' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/conv_lstm_cell/LayerNorm_1/gamma' type=VariableV2>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/conv_lstm_cell/LayerNorm_1/gamma/Assign' type=Assign>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/conv_lstm_cell/LayerNorm_1/gamma/read' type=Identity>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_1/moments/mean/reduction_indices' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_1/moments/mean' type=Mean>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_1/moments/StopGradient' type=StopGradient>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_1/moments/SquaredDifference' type=SquaredDifference>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_1/moments/variance/reduction_indices' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_1/moments/variance' type=Mean>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_1/batchnorm/add/y' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_1/batchnorm/add' type=Add>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_1/batchnorm/Rsqrt' type=Rsqrt>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_1/batchnorm/mul/Enter' type=Enter>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_1/batchnorm/mul' type=Mul>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_1/batchnorm/mul_1' type=Mul>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_1/batchnorm/mul_2' type=Mul>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_1/batchnorm/sub/Enter' type=Enter>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_1/batchnorm/sub' type=Sub>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_1/batchnorm/add_1' type=Add>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/conv_lstm_cell/LayerNorm_2/beta/Initializer/zeros' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/conv_lstm_cell/LayerNorm_2/beta' type=VariableV2>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/conv_lstm_cell/LayerNorm_2/beta/Assign' type=Assign>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/conv_lstm_cell/LayerNorm_2/beta/read' type=Identity>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/conv_lstm_cell/LayerNorm_2/gamma/Initializer/ones' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/conv_lstm_cell/LayerNorm_2/gamma' type=VariableV2>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/conv_lstm_cell/LayerNorm_2/gamma/Assign' type=Assign>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/conv_lstm_cell/LayerNorm_2/gamma/read' type=Identity>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_2/moments/mean/reduction_indices' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_2/moments/mean' type=Mean>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_2/moments/StopGradient' type=StopGradient>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_2/moments/SquaredDifference' type=SquaredDifference>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_2/moments/variance/reduction_indices' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_2/moments/variance' type=Mean>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_2/batchnorm/add/y' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_2/batchnorm/add' type=Add>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_2/batchnorm/Rsqrt' type=Rsqrt>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_2/batchnorm/mul/Enter' type=Enter>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_2/batchnorm/mul' type=Mul>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_2/batchnorm/mul_1' type=Mul>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_2/batchnorm/mul_2' type=Mul>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_2/batchnorm/sub/Enter' type=Enter>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_2/batchnorm/sub' type=Sub>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_2/batchnorm/add_1' type=Add>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/add/y' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/add' type=Add>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/Sigmoid' type=Sigmoid>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/Sigmoid_1' type=Sigmoid>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/mul' type=Mul>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/Tanh' type=Tanh>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/mul_1' type=Mul>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/add_1' type=Add>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/conv_lstm_cell/LayerNorm_3/beta/Initializer/zeros' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/conv_lstm_cell/LayerNorm_3/beta' type=VariableV2>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/conv_lstm_cell/LayerNorm_3/beta/Assign' type=Assign>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/conv_lstm_cell/LayerNorm_3/beta/read' type=Identity>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/conv_lstm_cell/LayerNorm_3/gamma/Initializer/ones' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/conv_lstm_cell/LayerNorm_3/gamma' type=VariableV2>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/conv_lstm_cell/LayerNorm_3/gamma/Assign' type=Assign>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/conv_lstm_cell/LayerNorm_3/gamma/read' type=Identity>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_3/moments/mean/reduction_indices' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_3/moments/mean' type=Mean>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_3/moments/StopGradient' type=StopGradient>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_3/moments/SquaredDifference' type=SquaredDifference>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_3/moments/variance/reduction_indices' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_3/moments/variance' type=Mean>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_3/batchnorm/add/y' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_3/batchnorm/add' type=Add>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_3/batchnorm/Rsqrt' type=Rsqrt>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_3/batchnorm/mul/Enter' type=Enter>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_3/batchnorm/mul' type=Mul>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_3/batchnorm/mul_1' type=Mul>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_3/batchnorm/mul_2' type=Mul>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_3/batchnorm/sub/Enter' type=Enter>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_3/batchnorm/sub' type=Sub>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_3/batchnorm/add_1' type=Add>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/conv_lstm_cell/LayerNorm_4/beta/Initializer/zeros' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/conv_lstm_cell/LayerNorm_4/beta' type=VariableV2>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/conv_lstm_cell/LayerNorm_4/beta/Assign' type=Assign>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/conv_lstm_cell/LayerNorm_4/beta/read' type=Identity>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/conv_lstm_cell/LayerNorm_4/gamma/Initializer/ones' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/conv_lstm_cell/LayerNorm_4/gamma' type=VariableV2>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/conv_lstm_cell/LayerNorm_4/gamma/Assign' type=Assign>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/conv_lstm_cell/LayerNorm_4/gamma/read' type=Identity>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_4/moments/mean/reduction_indices' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_4/moments/mean' type=Mean>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_4/moments/StopGradient' type=StopGradient>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_4/moments/SquaredDifference' type=SquaredDifference>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_4/moments/variance/reduction_indices' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_4/moments/variance' type=Mean>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_4/batchnorm/add/y' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_4/batchnorm/add' type=Add>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_4/batchnorm/Rsqrt' type=Rsqrt>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_4/batchnorm/mul/Enter' type=Enter>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_4/batchnorm/mul' type=Mul>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_4/batchnorm/mul_1' type=Mul>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_4/batchnorm/mul_2' type=Mul>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_4/batchnorm/sub/Enter' type=Enter>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_4/batchnorm/sub' type=Sub>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_4/batchnorm/add_1' type=Add>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/Sigmoid_2' type=Sigmoid>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/Tanh_1' type=Tanh>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/mul_2' type=Mul>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/GreaterEqual/Enter' type=Enter>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/GreaterEqual' type=GreaterEqual>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/Select/Enter' type=Enter>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/Select' type=Select>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/GreaterEqual_1' type=GreaterEqual>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/Select_1' type=Select>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/GreaterEqual_2' type=GreaterEqual>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/Select_2' type=Select>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/TensorArrayWrite/TensorArrayWriteV3/Enter' type=Enter>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/TensorArrayWrite/TensorArrayWriteV3' type=TensorArrayWriteV3>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/add/y' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/add' type=Add>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/NextIteration' type=NextIteration>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/NextIteration_1' type=NextIteration>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/NextIteration_2' type=NextIteration>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/NextIteration_3' type=NextIteration>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/Exit' type=Exit>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/Exit_1' type=Exit>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/Exit_2' type=Exit>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/Exit_3' type=Exit>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/TensorArrayStack/TensorArraySizeV3' type=TensorArraySizeV3>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/TensorArrayStack/range/start' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/TensorArrayStack/range/delta' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/TensorArrayStack/range' type=Range>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/TensorArrayStack/TensorArrayGatherV3' type=TensorArrayGatherV3>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/Const_2' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/Rank_2' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/range_2/start' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/range_2/delta' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/range_2' type=Range>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/concat_1/values_0' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/concat_1/axis' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/concat_1' type=ConcatV2>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/transpose' type=Transpose>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/ReverseSequence' type=ReverseSequence>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/Rank' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/range/start' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/range/delta' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/range' type=Range>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/concat/values_0' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/concat/axis' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/concat' type=ConcatV2>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/transpose' type=Transpose>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/sequence_length' type=Identity>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/bw/Shape' type=Shape>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/bw/strided_slice/stack' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/bw/strided_slice/stack_1' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/bw/strided_slice/stack_2' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/bw/strided_slice' type=StridedSlice>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/bw/DropoutWrapperZeroState/ConvLSTMCellZeroState/ExpandDims/dim' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/bw/DropoutWrapperZeroState/ConvLSTMCellZeroState/ExpandDims' type=ExpandDims>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/bw/DropoutWrapperZeroState/ConvLSTMCellZeroState/Const' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/bw/DropoutWrapperZeroState/ConvLSTMCellZeroState/concat/axis' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/bw/DropoutWrapperZeroState/ConvLSTMCellZeroState/concat' type=ConcatV2>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/bw/DropoutWrapperZeroState/ConvLSTMCellZeroState/zeros/Const' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/bw/DropoutWrapperZeroState/ConvLSTMCellZeroState/zeros' type=Fill>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/bw/DropoutWrapperZeroState/ConvLSTMCellZeroState/ExpandDims_1/dim' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/bw/DropoutWrapperZeroState/ConvLSTMCellZeroState/ExpandDims_1' type=ExpandDims>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/bw/DropoutWrapperZeroState/ConvLSTMCellZeroState/Const_1' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/bw/DropoutWrapperZeroState/ConvLSTMCellZeroState/ExpandDims_2/dim' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/bw/DropoutWrapperZeroState/ConvLSTMCellZeroState/ExpandDims_2' type=ExpandDims>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/bw/DropoutWrapperZeroState/ConvLSTMCellZeroState/Const_2' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/bw/DropoutWrapperZeroState/ConvLSTMCellZeroState/concat_1/axis' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/bw/DropoutWrapperZeroState/ConvLSTMCellZeroState/concat_1' type=ConcatV2>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/bw/DropoutWrapperZeroState/ConvLSTMCellZeroState/zeros_1/Const' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/bw/DropoutWrapperZeroState/ConvLSTMCellZeroState/zeros_1' type=Fill>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/bw/DropoutWrapperZeroState/ConvLSTMCellZeroState/ExpandDims_3/dim' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/bw/DropoutWrapperZeroState/ConvLSTMCellZeroState/ExpandDims_3' type=ExpandDims>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/bw/DropoutWrapperZeroState/ConvLSTMCellZeroState/Const_3' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/bw/Shape_1' type=Shape>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/bw/stack' type=Pack>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/bw/Equal' type=Equal>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/bw/Const' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/bw/All' type=All>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/bw/Assert/Const' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/bw/Assert/Const_1' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/bw/Assert/Assert/data_0' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/bw/Assert/Assert/data_2' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/bw/Assert/Assert' type=Assert>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/bw/CheckSeqLen' type=Identity>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/bw/Shape_2' type=Shape>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/bw/strided_slice_1/stack' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/bw/strided_slice_1/stack_1' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/bw/strided_slice_1/stack_2' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/bw/strided_slice_1' type=StridedSlice>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/bw/Shape_3' type=Shape>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/bw/strided_slice_2/stack' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/bw/strided_slice_2/stack_1' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/bw/strided_slice_2/stack_2' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/bw/strided_slice_2' type=StridedSlice>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/bw/ExpandDims/dim' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/bw/ExpandDims' type=ExpandDims>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/bw/Const_1' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/bw/concat/axis' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/bw/concat' type=ConcatV2>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/bw/zeros/Const' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/bw/zeros' type=Fill>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/bw/Rank' type=Rank>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/bw/range/start' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/bw/range/delta' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/bw/range' type=Range>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/bw/Min' type=Min>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/bw/Rank_1' type=Rank>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/bw/range_1/start' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/bw/range_1/delta' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/bw/range_1' type=Range>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/bw/Max' type=Max>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/bw/time' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/bw/TensorArray' type=TensorArrayV3>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/bw/TensorArray_1' type=TensorArrayV3>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/bw/TensorArrayUnstack/Shape' type=Shape>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/bw/TensorArrayUnstack/strided_slice/stack' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/bw/TensorArrayUnstack/strided_slice/stack_1' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/bw/TensorArrayUnstack/strided_slice/stack_2' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/bw/TensorArrayUnstack/strided_slice' type=StridedSlice>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/bw/TensorArrayUnstack/range/start' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/bw/TensorArrayUnstack/range/delta' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/bw/TensorArrayUnstack/range' type=Range>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/bw/TensorArrayUnstack/TensorArrayScatter/TensorArrayScatterV3' type=TensorArrayScatterV3>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/bw/while/Enter' type=Enter>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/bw/while/Enter_1' type=Enter>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/bw/while/Enter_2' type=Enter>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/bw/while/Enter_3' type=Enter>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/bw/while/Merge' type=Merge>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/bw/while/Merge_1' type=Merge>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/bw/while/Merge_2' type=Merge>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/bw/while/Merge_3' type=Merge>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/bw/while/Less/Enter' type=Enter>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/bw/while/Less' type=Less>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/bw/while/LoopCond' type=LoopCond>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/bw/while/Switch' type=Switch>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/bw/while/Switch_1' type=Switch>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/bw/while/Switch_2' type=Switch>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/bw/while/Switch_3' type=Switch>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/bw/while/Identity' type=Identity>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/bw/while/Identity_1' type=Identity>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/bw/while/Identity_2' type=Identity>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/bw/while/Identity_3' type=Identity>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/bw/while/TensorArrayReadV3/Enter' type=Enter>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/bw/while/TensorArrayReadV3/Enter_1' type=Enter>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/bw/while/TensorArrayReadV3' type=TensorArrayReadV3>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/concat_1/axis' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/concat_1' type=ConcatV2>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/Const_2' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/MirrorPad_1' type=MirrorPad>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/convolution_1/dilation_rate' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/convolution_1/Enter' type=Enter>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/convolution_1' type=Conv2D>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/Const_3' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/split_1/split_dim' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/split_1' type=Split>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_5/moments/mean/reduction_indices' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_5/moments/mean' type=Mean>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_5/moments/StopGradient' type=StopGradient>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_5/moments/SquaredDifference' type=SquaredDifference>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_5/moments/variance/reduction_indices' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_5/moments/variance' type=Mean>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_5/batchnorm/add/y' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_5/batchnorm/add' type=Add>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_5/batchnorm/Rsqrt' type=Rsqrt>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_5/batchnorm/mul/Enter' type=Enter>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_5/batchnorm/mul' type=Mul>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_5/batchnorm/mul_1' type=Mul>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_5/batchnorm/mul_2' type=Mul>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_5/batchnorm/sub/Enter' type=Enter>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_5/batchnorm/sub' type=Sub>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_5/batchnorm/add_1' type=Add>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_6/moments/mean/reduction_indices' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_6/moments/mean' type=Mean>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_6/moments/StopGradient' type=StopGradient>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_6/moments/SquaredDifference' type=SquaredDifference>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_6/moments/variance/reduction_indices' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_6/moments/variance' type=Mean>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_6/batchnorm/add/y' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_6/batchnorm/add' type=Add>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_6/batchnorm/Rsqrt' type=Rsqrt>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_6/batchnorm/mul/Enter' type=Enter>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_6/batchnorm/mul' type=Mul>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_6/batchnorm/mul_1' type=Mul>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_6/batchnorm/mul_2' type=Mul>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_6/batchnorm/sub/Enter' type=Enter>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_6/batchnorm/sub' type=Sub>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_6/batchnorm/add_1' type=Add>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_7/moments/mean/reduction_indices' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_7/moments/mean' type=Mean>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_7/moments/StopGradient' type=StopGradient>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_7/moments/SquaredDifference' type=SquaredDifference>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_7/moments/variance/reduction_indices' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_7/moments/variance' type=Mean>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_7/batchnorm/add/y' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_7/batchnorm/add' type=Add>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_7/batchnorm/Rsqrt' type=Rsqrt>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_7/batchnorm/mul/Enter' type=Enter>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_7/batchnorm/mul' type=Mul>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_7/batchnorm/mul_1' type=Mul>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_7/batchnorm/mul_2' type=Mul>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_7/batchnorm/sub/Enter' type=Enter>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_7/batchnorm/sub' type=Sub>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_7/batchnorm/add_1' type=Add>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/add_2/y' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/add_2' type=Add>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/Sigmoid_3' type=Sigmoid>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/Sigmoid_4' type=Sigmoid>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/mul_3' type=Mul>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/Tanh_2' type=Tanh>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/mul_4' type=Mul>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/add_3' type=Add>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_8/moments/mean/reduction_indices' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_8/moments/mean' type=Mean>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_8/moments/StopGradient' type=StopGradient>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_8/moments/SquaredDifference' type=SquaredDifference>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_8/moments/variance/reduction_indices' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_8/moments/variance' type=Mean>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_8/batchnorm/add/y' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_8/batchnorm/add' type=Add>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_8/batchnorm/Rsqrt' type=Rsqrt>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_8/batchnorm/mul/Enter' type=Enter>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_8/batchnorm/mul' type=Mul>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_8/batchnorm/mul_1' type=Mul>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_8/batchnorm/mul_2' type=Mul>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_8/batchnorm/sub/Enter' type=Enter>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_8/batchnorm/sub' type=Sub>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_8/batchnorm/add_1' type=Add>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_9/moments/mean/reduction_indices' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_9/moments/mean' type=Mean>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_9/moments/StopGradient' type=StopGradient>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_9/moments/SquaredDifference' type=SquaredDifference>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_9/moments/variance/reduction_indices' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_9/moments/variance' type=Mean>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_9/batchnorm/add/y' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_9/batchnorm/add' type=Add>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_9/batchnorm/Rsqrt' type=Rsqrt>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_9/batchnorm/mul/Enter' type=Enter>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_9/batchnorm/mul' type=Mul>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_9/batchnorm/mul_1' type=Mul>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_9/batchnorm/mul_2' type=Mul>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_9/batchnorm/sub/Enter' type=Enter>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_9/batchnorm/sub' type=Sub>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/LayerNorm_9/batchnorm/add_1' type=Add>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/Sigmoid_5' type=Sigmoid>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/Tanh_3' type=Tanh>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/fw/fw/while/fw/conv_lstm_cell/mul_5' type=Mul>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/bw/while/GreaterEqual/Enter' type=Enter>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/bw/while/GreaterEqual' type=GreaterEqual>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/bw/while/Select/Enter' type=Enter>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/bw/while/Select' type=Select>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/bw/while/GreaterEqual_1' type=GreaterEqual>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/bw/while/Select_1' type=Select>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/bw/while/GreaterEqual_2' type=GreaterEqual>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/bw/while/Select_2' type=Select>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/bw/while/TensorArrayWrite/TensorArrayWriteV3/Enter' type=Enter>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/bw/while/TensorArrayWrite/TensorArrayWriteV3' type=TensorArrayWriteV3>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/bw/while/add/y' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/bw/while/add' type=Add>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/bw/while/NextIteration' type=NextIteration>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/bw/while/NextIteration_1' type=NextIteration>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/bw/while/NextIteration_2' type=NextIteration>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/bw/while/NextIteration_3' type=NextIteration>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/bw/while/Exit' type=Exit>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/bw/while/Exit_1' type=Exit>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/bw/while/Exit_2' type=Exit>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/bw/while/Exit_3' type=Exit>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/bw/TensorArrayStack/TensorArraySizeV3' type=TensorArraySizeV3>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/bw/TensorArrayStack/range/start' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/bw/TensorArrayStack/range/delta' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/bw/TensorArrayStack/range' type=Range>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/bw/TensorArrayStack/TensorArrayGatherV3' type=TensorArrayGatherV3>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/bw/Const_2' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/bw/Rank_2' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/bw/range_2/start' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/bw/range_2/delta' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/bw/range_2' type=Range>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/bw/concat_1/values_0' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/bw/concat_1/axis' type=Const>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/bw/concat_1' type=ConcatV2>,\n",
       " <tf.Operation 'convrnn1/bidirectional_rnn/bw/bw/transpose' type=Transpose>,\n",
       " <tf.Operation 'convrnn1/ReverseSequence' type=ReverseSequence>,\n",
       " <tf.Operation 'convrnn1/concat/axis' type=Const>,\n",
       " <tf.Operation 'convrnn1/concat' type=ConcatV2>,\n",
       " <tf.Operation 'convrnn1/concat_1/axis' type=Const>,\n",
       " <tf.Operation 'convrnn1/concat_1' type=ConcatV2>,\n",
       " <tf.Operation 'convrnn1/concat_2/axis' type=Const>,\n",
       " <tf.Operation 'convrnn1/concat_2' type=ConcatV2>,\n",
       " <tf.Operation 'convrnn1/outputs' type=Identity>,\n",
       " <tf.Operation 'convrnn1/final_states' type=Identity>,\n",
       " <tf.Operation 'concat/concat_dim' type=Const>,\n",
       " <tf.Operation 'concat' type=Identity>,\n",
       " <tf.Operation 'concat_1/concat_dim' type=Const>,\n",
       " <tf.Operation 'concat_1' type=Identity>,\n",
       " <tf.Operation 'class/conv/Const' type=Const>,\n",
       " <tf.Operation 'class/conv/MirrorPad' type=MirrorPad>,\n",
       " <tf.Operation 'class/conv2d/kernel/Initializer/random_uniform/shape' type=Const>,\n",
       " <tf.Operation 'class/conv2d/kernel/Initializer/random_uniform/min' type=Const>,\n",
       " <tf.Operation 'class/conv2d/kernel/Initializer/random_uniform/max' type=Const>,\n",
       " <tf.Operation 'class/conv2d/kernel/Initializer/random_uniform/RandomUniform' type=RandomUniform>,\n",
       " <tf.Operation 'class/conv2d/kernel/Initializer/random_uniform/sub' type=Sub>,\n",
       " <tf.Operation 'class/conv2d/kernel/Initializer/random_uniform/mul' type=Mul>,\n",
       " <tf.Operation 'class/conv2d/kernel/Initializer/random_uniform' type=Add>,\n",
       " <tf.Operation 'class/conv2d/kernel' type=VariableV2>,\n",
       " <tf.Operation 'class/conv2d/kernel/Assign' type=Assign>,\n",
       " <tf.Operation 'class/conv2d/kernel/read' type=Identity>,\n",
       " <tf.Operation 'class/conv/conv2d/dilation_rate' type=Const>,\n",
       " <tf.Operation 'class/conv/conv2d/Conv2D' type=Conv2D>,\n",
       " <tf.Operation 'class/cond/Switch' type=Switch>,\n",
       " <tf.Operation 'class/cond/switch_t' type=Identity>,\n",
       " <tf.Operation 'class/cond/switch_f' type=Identity>,\n",
       " <tf.Operation 'class/cond/pred_id' type=Identity>,\n",
       " <tf.Operation 'class/bn/beta/Initializer/zeros' type=Const>,\n",
       " <tf.Operation 'class/bn/beta' type=VariableV2>,\n",
       " <tf.Operation 'class/bn/beta/Assign' type=Assign>,\n",
       " <tf.Operation 'class/bn/beta/read' type=Identity>,\n",
       " <tf.Operation 'class/bn/gamma/Initializer/ones' type=Const>,\n",
       " <tf.Operation 'class/bn/gamma' type=VariableV2>,\n",
       " <tf.Operation 'class/bn/gamma/Assign' type=Assign>,\n",
       " <tf.Operation 'class/bn/gamma/read' type=Identity>,\n",
       " <tf.Operation 'class/bn/moving_mean/Initializer/zeros' type=Const>,\n",
       " <tf.Operation 'class/bn/moving_mean' type=VariableV2>,\n",
       " <tf.Operation 'class/bn/moving_mean/Assign' type=Assign>,\n",
       " <tf.Operation 'class/bn/moving_mean/read' type=Identity>,\n",
       " <tf.Operation 'class/bn/moving_variance/Initializer/ones' type=Const>,\n",
       " <tf.Operation 'class/bn/moving_variance' type=VariableV2>,\n",
       " <tf.Operation 'class/bn/moving_variance/Assign' type=Assign>,\n",
       " <tf.Operation 'class/bn/moving_variance/read' type=Identity>,\n",
       " <tf.Operation 'class/cond/bn/cond/Switch/Switch' type=Switch>,\n",
       " <tf.Operation 'class/cond/bn/cond/Switch' type=Switch>,\n",
       " <tf.Operation 'class/cond/bn/cond/switch_t' type=Identity>,\n",
       " <tf.Operation 'class/cond/bn/cond/switch_f' type=Identity>,\n",
       " <tf.Operation 'class/cond/bn/cond/pred_id' type=Identity>,\n",
       " <tf.Operation 'class/cond/bn/cond/Const' type=Const>,\n",
       " <tf.Operation 'class/cond/bn/cond/Const_1' type=Const>,\n",
       " <tf.Operation 'class/cond/bn/cond/FusedBatchNorm/Switch' type=Switch>,\n",
       " <tf.Operation 'class/cond/bn/cond/FusedBatchNorm/Switch_1' type=Switch>,\n",
       " <tf.Operation 'class/cond/bn/cond/FusedBatchNorm/Switch_2' type=Switch>,\n",
       " <tf.Operation 'class/cond/bn/cond/FusedBatchNorm/Switch_3' type=Switch>,\n",
       " <tf.Operation 'class/cond/bn/cond/FusedBatchNorm/Switch_4' type=Switch>,\n",
       " <tf.Operation 'class/cond/bn/cond/FusedBatchNorm/Switch_5' type=Switch>,\n",
       " <tf.Operation 'class/cond/bn/cond/FusedBatchNorm' type=FusedBatchNorm>,\n",
       " <tf.Operation 'class/cond/bn/cond/FusedBatchNorm_1/Switch' type=Switch>,\n",
       " <tf.Operation 'class/cond/bn/cond/FusedBatchNorm_1/Switch_1' type=Switch>,\n",
       " <tf.Operation 'class/cond/bn/cond/FusedBatchNorm_1/Switch_2' type=Switch>,\n",
       " <tf.Operation 'class/cond/bn/cond/FusedBatchNorm_1/Switch_3' type=Switch>,\n",
       " <tf.Operation 'class/cond/bn/cond/FusedBatchNorm_1/Switch_4' type=Switch>,\n",
       " <tf.Operation 'class/cond/bn/cond/FusedBatchNorm_1/Switch_5' type=Switch>,\n",
       " <tf.Operation 'class/cond/bn/cond/FusedBatchNorm_1/Switch_6' type=Switch>,\n",
       " <tf.Operation 'class/cond/bn/cond/FusedBatchNorm_1' type=FusedBatchNorm>,\n",
       " <tf.Operation 'class/cond/bn/cond/Merge' type=Merge>,\n",
       " <tf.Operation 'class/cond/bn/cond/Merge_1' type=Merge>,\n",
       " <tf.Operation 'class/cond/bn/cond/Merge_2' type=Merge>,\n",
       " <tf.Operation 'class/cond/bn/cond_1/Switch' type=Switch>,\n",
       " <tf.Operation 'class/cond/bn/cond_1/switch_t' type=Identity>,\n",
       " <tf.Operation 'class/cond/bn/cond_1/switch_f' type=Identity>,\n",
       " <tf.Operation 'class/cond/bn/cond_1/pred_id' type=Identity>,\n",
       " <tf.Operation 'class/cond/bn/cond_1/AssignMovingAvg/decay' type=Const>,\n",
       " <tf.Operation 'class/cond/bn/cond_1/AssignMovingAvg/class/bn/moving_mean/zeros' type=Const>,\n",
       " <tf.Operation 'class/bn/class/bn/moving_mean/biased' type=VariableV2>,\n",
       " <tf.Operation 'class/bn/class/bn/moving_mean/biased/Assign' type=Assign>,\n",
       " <tf.Operation 'class/bn/class/bn/moving_mean/biased/read' type=Identity>,\n",
       " <tf.Operation 'class/bn/class/bn/moving_mean/local_step/Initializer/zeros' type=Const>,\n",
       " <tf.Operation 'class/bn/class/bn/moving_mean/local_step' type=VariableV2>,\n",
       " <tf.Operation 'class/bn/class/bn/moving_mean/local_step/Assign' type=Assign>,\n",
       " <tf.Operation 'class/bn/class/bn/moving_mean/local_step/read' type=Identity>,\n",
       " <tf.Operation 'class/cond/bn/cond_1/AssignMovingAvg/class/bn/moving_mean/sub/Switch' type=Switch>,\n",
       " <tf.Operation 'class/cond/bn/cond_1/AssignMovingAvg/class/bn/moving_mean/sub/Switch_1' type=Switch>,\n",
       " <tf.Operation 'class/cond/bn/cond_1/AssignMovingAvg/class/bn/moving_mean/sub/Switch_2' type=Switch>,\n",
       " <tf.Operation 'class/cond/bn/cond_1/AssignMovingAvg/class/bn/moving_mean/sub' type=Sub>,\n",
       " <tf.Operation 'class/cond/bn/cond_1/AssignMovingAvg/class/bn/moving_mean/mul' type=Mul>,\n",
       " <tf.Operation 'class/cond/bn/cond_1/AssignMovingAvg/class/bn/moving_mean/class/bn/class/bn/moving_mean/Switch' type=RefSwitch>,\n",
       " <tf.Operation 'class/cond/bn/cond_1/AssignMovingAvg/class/bn/moving_mean/class/bn/class/bn/moving_mean/Switch_1' type=RefSwitch>,\n",
       " <tf.Operation 'class/cond/bn/cond_1/AssignMovingAvg/class/bn/moving_mean/class/bn/class/bn/moving_mean' type=AssignSub>,\n",
       " <tf.Operation 'class/cond/bn/cond_1/AssignMovingAvg/class/bn/moving_mean/AssignAdd/value' type=Const>,\n",
       " <tf.Operation 'class/cond/bn/cond_1/AssignMovingAvg/class/bn/moving_mean/AssignAdd/Switch' type=RefSwitch>,\n",
       " <tf.Operation 'class/cond/bn/cond_1/AssignMovingAvg/class/bn/moving_mean/AssignAdd/Switch_1' type=RefSwitch>,\n",
       " <tf.Operation 'class/cond/bn/cond_1/AssignMovingAvg/class/bn/moving_mean/AssignAdd' type=AssignAdd>,\n",
       " <tf.Operation 'class/cond/bn/cond_1/AssignMovingAvg/class/bn/moving_mean/read' type=Identity>,\n",
       " <tf.Operation 'class/cond/bn/cond_1/AssignMovingAvg/class/bn/moving_mean/sub_1/x' type=Const>,\n",
       " <tf.Operation 'class/cond/bn/cond_1/AssignMovingAvg/class/bn/moving_mean/sub_1' type=Sub>,\n",
       " <tf.Operation 'class/cond/bn/cond_1/AssignMovingAvg/class/bn/moving_mean/read_1' type=Identity>,\n",
       " <tf.Operation 'class/cond/bn/cond_1/AssignMovingAvg/class/bn/moving_mean/Pow' type=Pow>,\n",
       " <tf.Operation 'class/cond/bn/cond_1/AssignMovingAvg/class/bn/moving_mean/sub_2/x' type=Const>,\n",
       " <tf.Operation 'class/cond/bn/cond_1/AssignMovingAvg/class/bn/moving_mean/sub_2' type=Sub>,\n",
       " <tf.Operation 'class/cond/bn/cond_1/AssignMovingAvg/class/bn/moving_mean/truediv' type=RealDiv>,\n",
       " <tf.Operation 'class/cond/bn/cond_1/AssignMovingAvg/class/bn/moving_mean/sub_3/Switch' type=Switch>,\n",
       " <tf.Operation 'class/cond/bn/cond_1/AssignMovingAvg/class/bn/moving_mean/sub_3' type=Sub>,\n",
       " <tf.Operation 'class/cond/bn/cond_1/AssignMovingAvg/Switch' type=RefSwitch>,\n",
       " <tf.Operation 'class/cond/bn/cond_1/AssignMovingAvg/Switch_1' type=RefSwitch>,\n",
       " <tf.Operation 'class/cond/bn/cond_1/AssignMovingAvg' type=AssignSub>,\n",
       " <tf.Operation 'class/cond/bn/cond_1/AssignMovingAvg_1/decay' type=Const>,\n",
       " <tf.Operation 'class/cond/bn/cond_1/AssignMovingAvg_1/sub/Switch' type=Switch>,\n",
       " <tf.Operation 'class/cond/bn/cond_1/AssignMovingAvg_1/sub/Switch_1' type=Switch>,\n",
       " <tf.Operation 'class/cond/bn/cond_1/AssignMovingAvg_1/sub' type=Sub>,\n",
       " <tf.Operation 'class/cond/bn/cond_1/AssignMovingAvg_1/mul' type=Mul>,\n",
       " <tf.Operation 'class/cond/bn/cond_1/AssignMovingAvg_1/Switch' type=RefSwitch>,\n",
       " <tf.Operation 'class/cond/bn/cond_1/AssignMovingAvg_1/Switch_1' type=RefSwitch>,\n",
       " <tf.Operation 'class/cond/bn/cond_1/AssignMovingAvg_1' type=AssignSub>,\n",
       " <tf.Operation 'class/cond/bn/cond_1/Identity/Switch' type=Switch>,\n",
       " <tf.Operation 'class/cond/bn/cond_1/Identity' type=Identity>,\n",
       " <tf.Operation 'class/cond/bn/cond_1/Switch_1' type=Switch>,\n",
       " <tf.Operation 'class/cond/bn/cond_1/Merge' type=Merge>,\n",
       " <tf.Operation 'class/cond/bn_1/cond/Switch/Switch' type=Switch>,\n",
       " <tf.Operation 'class/cond/bn_1/cond/Switch' type=Switch>,\n",
       " <tf.Operation 'class/cond/bn_1/cond/switch_t' type=Identity>,\n",
       " <tf.Operation 'class/cond/bn_1/cond/switch_f' type=Identity>,\n",
       " <tf.Operation 'class/cond/bn_1/cond/pred_id' type=Identity>,\n",
       " <tf.Operation 'class/cond/bn_1/cond/Const' type=Const>,\n",
       " <tf.Operation 'class/cond/bn_1/cond/Const_1' type=Const>,\n",
       " <tf.Operation 'class/cond/bn_1/cond/FusedBatchNorm/Switch' type=Switch>,\n",
       " <tf.Operation 'class/cond/bn_1/cond/FusedBatchNorm/Switch_1' type=Switch>,\n",
       " <tf.Operation 'class/cond/bn_1/cond/FusedBatchNorm/Switch_2' type=Switch>,\n",
       " <tf.Operation 'class/cond/bn_1/cond/FusedBatchNorm/Switch_3' type=Switch>,\n",
       " <tf.Operation 'class/cond/bn_1/cond/FusedBatchNorm/Switch_4' type=Switch>,\n",
       " <tf.Operation 'class/cond/bn_1/cond/FusedBatchNorm/Switch_5' type=Switch>,\n",
       " <tf.Operation 'class/cond/bn_1/cond/FusedBatchNorm' type=FusedBatchNorm>,\n",
       " <tf.Operation 'class/cond/bn_1/cond/FusedBatchNorm_1/Switch' type=Switch>,\n",
       " <tf.Operation 'class/cond/bn_1/cond/FusedBatchNorm_1/Switch_1' type=Switch>,\n",
       " <tf.Operation 'class/cond/bn_1/cond/FusedBatchNorm_1/Switch_2' type=Switch>,\n",
       " <tf.Operation 'class/cond/bn_1/cond/FusedBatchNorm_1/Switch_3' type=Switch>,\n",
       " <tf.Operation 'class/cond/bn_1/cond/FusedBatchNorm_1/Switch_4' type=Switch>,\n",
       " <tf.Operation 'class/cond/bn_1/cond/FusedBatchNorm_1/Switch_5' type=Switch>,\n",
       " <tf.Operation 'class/cond/bn_1/cond/FusedBatchNorm_1/Switch_6' type=Switch>,\n",
       " <tf.Operation 'class/cond/bn_1/cond/FusedBatchNorm_1' type=FusedBatchNorm>,\n",
       " <tf.Operation 'class/cond/bn_1/cond/Merge' type=Merge>,\n",
       " <tf.Operation 'class/cond/bn_1/cond/Merge_1' type=Merge>,\n",
       " <tf.Operation 'class/cond/bn_1/cond/Merge_2' type=Merge>,\n",
       " <tf.Operation 'class/cond/bn_1/cond_1/Switch' type=Switch>,\n",
       " <tf.Operation 'class/cond/bn_1/cond_1/switch_t' type=Identity>,\n",
       " <tf.Operation 'class/cond/bn_1/cond_1/switch_f' type=Identity>,\n",
       " <tf.Operation 'class/cond/bn_1/cond_1/pred_id' type=Identity>,\n",
       " <tf.Operation 'class/cond/bn_1/cond_1/AssignMovingAvg/decay' type=Const>,\n",
       " <tf.Operation 'class/cond/bn_1/cond_1/AssignMovingAvg/class/bn/moving_mean/zeros' type=Const>,\n",
       " <tf.Operation 'class/cond/bn_1/cond_1/AssignMovingAvg/class/bn/moving_mean/sub/Switch' type=Switch>,\n",
       " <tf.Operation 'class/cond/bn_1/cond_1/AssignMovingAvg/class/bn/moving_mean/sub/Switch_1' type=Switch>,\n",
       " <tf.Operation 'class/cond/bn_1/cond_1/AssignMovingAvg/class/bn/moving_mean/sub/Switch_2' type=Switch>,\n",
       " <tf.Operation 'class/cond/bn_1/cond_1/AssignMovingAvg/class/bn/moving_mean/sub' type=Sub>,\n",
       " <tf.Operation 'class/cond/bn_1/cond_1/AssignMovingAvg/class/bn/moving_mean/mul' type=Mul>,\n",
       " <tf.Operation 'class/cond/bn_1/cond_1/AssignMovingAvg/class/bn/moving_mean/class/bn/class/bn/moving_mean/Switch' type=RefSwitch>,\n",
       " <tf.Operation 'class/cond/bn_1/cond_1/AssignMovingAvg/class/bn/moving_mean/class/bn/class/bn/moving_mean/Switch_1' type=RefSwitch>,\n",
       " <tf.Operation 'class/cond/bn_1/cond_1/AssignMovingAvg/class/bn/moving_mean/class/bn/class/bn/moving_mean' type=AssignSub>,\n",
       " <tf.Operation 'class/cond/bn_1/cond_1/AssignMovingAvg/class/bn/moving_mean/AssignAdd/value' type=Const>,\n",
       " <tf.Operation 'class/cond/bn_1/cond_1/AssignMovingAvg/class/bn/moving_mean/AssignAdd/Switch' type=RefSwitch>,\n",
       " <tf.Operation 'class/cond/bn_1/cond_1/AssignMovingAvg/class/bn/moving_mean/AssignAdd/Switch_1' type=RefSwitch>,\n",
       " <tf.Operation 'class/cond/bn_1/cond_1/AssignMovingAvg/class/bn/moving_mean/AssignAdd' type=AssignAdd>,\n",
       " <tf.Operation 'class/cond/bn_1/cond_1/AssignMovingAvg/class/bn/moving_mean/read' type=Identity>,\n",
       " <tf.Operation 'class/cond/bn_1/cond_1/AssignMovingAvg/class/bn/moving_mean/sub_1/x' type=Const>,\n",
       " <tf.Operation 'class/cond/bn_1/cond_1/AssignMovingAvg/class/bn/moving_mean/sub_1' type=Sub>,\n",
       " <tf.Operation 'class/cond/bn_1/cond_1/AssignMovingAvg/class/bn/moving_mean/read_1' type=Identity>,\n",
       " <tf.Operation 'class/cond/bn_1/cond_1/AssignMovingAvg/class/bn/moving_mean/Pow' type=Pow>,\n",
       " <tf.Operation 'class/cond/bn_1/cond_1/AssignMovingAvg/class/bn/moving_mean/sub_2/x' type=Const>,\n",
       " <tf.Operation 'class/cond/bn_1/cond_1/AssignMovingAvg/class/bn/moving_mean/sub_2' type=Sub>,\n",
       " <tf.Operation 'class/cond/bn_1/cond_1/AssignMovingAvg/class/bn/moving_mean/truediv' type=RealDiv>,\n",
       " <tf.Operation 'class/cond/bn_1/cond_1/AssignMovingAvg/class/bn/moving_mean/sub_3/Switch' type=Switch>,\n",
       " <tf.Operation 'class/cond/bn_1/cond_1/AssignMovingAvg/class/bn/moving_mean/sub_3' type=Sub>,\n",
       " <tf.Operation 'class/cond/bn_1/cond_1/AssignMovingAvg/Switch' type=RefSwitch>,\n",
       " <tf.Operation 'class/cond/bn_1/cond_1/AssignMovingAvg/Switch_1' type=RefSwitch>,\n",
       " <tf.Operation 'class/cond/bn_1/cond_1/AssignMovingAvg' type=AssignSub>,\n",
       " <tf.Operation 'class/cond/bn_1/cond_1/AssignMovingAvg_1/decay' type=Const>,\n",
       " <tf.Operation 'class/cond/bn_1/cond_1/AssignMovingAvg_1/sub/Switch' type=Switch>,\n",
       " <tf.Operation 'class/cond/bn_1/cond_1/AssignMovingAvg_1/sub/Switch_1' type=Switch>,\n",
       " <tf.Operation 'class/cond/bn_1/cond_1/AssignMovingAvg_1/sub' type=Sub>,\n",
       " <tf.Operation 'class/cond/bn_1/cond_1/AssignMovingAvg_1/mul' type=Mul>,\n",
       " <tf.Operation 'class/cond/bn_1/cond_1/AssignMovingAvg_1/Switch' type=RefSwitch>,\n",
       " <tf.Operation 'class/cond/bn_1/cond_1/AssignMovingAvg_1/Switch_1' type=RefSwitch>,\n",
       " <tf.Operation 'class/cond/bn_1/cond_1/AssignMovingAvg_1' type=AssignSub>,\n",
       " <tf.Operation 'class/cond/bn_1/cond_1/Identity/Switch' type=Switch>,\n",
       " <tf.Operation 'class/cond/bn_1/cond_1/Identity' type=Identity>,\n",
       " <tf.Operation 'class/cond/bn_1/cond_1/Switch_1' type=Switch>,\n",
       " <tf.Operation 'class/cond/bn_1/cond_1/Merge' type=Merge>,\n",
       " <tf.Operation 'class/cond/Merge' type=Merge>,\n",
       " <tf.Operation 'class/LeakyRelu/alpha' type=Const>,\n",
       " <tf.Operation 'class/LeakyRelu/mul' type=Mul>,\n",
       " <tf.Operation 'class/LeakyRelu/Maximum' type=Maximum>,\n",
       " <tf.Operation 'strided_slice/stack' type=Const>,\n",
       " <tf.Operation 'strided_slice/stack_1' type=Const>,\n",
       " <tf.Operation 'strided_slice/stack_2' type=Const>,\n",
       " <tf.Operation 'strided_slice' type=StridedSlice>,\n",
       " <tf.Operation 'one_hot/on_value' type=Const>,\n",
       " <tf.Operation 'one_hot/off_value' type=Const>,\n",
       " <tf.Operation 'one_hot/depth' type=Const>,\n",
       " <tf.Operation 'one_hot' type=OneHot>,\n",
       " <tf.Operation 'strided_slice_1/stack' type=Const>,\n",
       " <tf.Operation 'strided_slice_1/stack_1' type=Const>,\n",
       " <tf.Operation 'strided_slice_1/stack_2' type=Const>,\n",
       " <tf.Operation 'strided_slice_1' type=StridedSlice>,\n",
       " <tf.Operation 'Cast_1' type=Cast>,\n",
       " <tf.Operation 'LogicalNot' type=LogicalNot>,\n",
       " <tf.Operation 'strided_slice_2/stack' type=Const>,\n",
       " <tf.Operation 'strided_slice_2/stack_1' type=Const>,\n",
       " <tf.Operation 'strided_slice_2/stack_2' type=Const>,\n",
       " <tf.Operation 'strided_slice_2' type=StridedSlice>,\n",
       " <tf.Operation 'Rank' type=Const>,\n",
       " <tf.Operation 'Shape' type=Shape>,\n",
       " <tf.Operation 'Rank_1' type=Const>,\n",
       " <tf.Operation 'Shape_1' type=Shape>,\n",
       " <tf.Operation 'Sub/y' type=Const>,\n",
       " <tf.Operation 'Sub' type=Sub>,\n",
       " <tf.Operation 'Slice/begin' type=Pack>,\n",
       " <tf.Operation 'Slice/size' type=Const>,\n",
       " <tf.Operation 'Slice' type=Slice>,\n",
       " <tf.Operation 'concat_2/values_0' type=Const>,\n",
       " <tf.Operation 'concat_2/axis' type=Const>,\n",
       " <tf.Operation 'concat_2' type=ConcatV2>,\n",
       " <tf.Operation 'Reshape' type=Reshape>,\n",
       " <tf.Operation 'Rank_2' type=Const>,\n",
       " <tf.Operation 'Shape_2' type=Shape>,\n",
       " <tf.Operation 'Sub_1/y' type=Const>,\n",
       " <tf.Operation 'Sub_1' type=Sub>,\n",
       " <tf.Operation 'Slice_1/begin' type=Pack>,\n",
       " <tf.Operation 'Slice_1/size' type=Const>,\n",
       " <tf.Operation 'Slice_1' type=Slice>,\n",
       " <tf.Operation 'concat_3/values_0' type=Const>,\n",
       " <tf.Operation 'concat_3/axis' type=Const>,\n",
       " <tf.Operation 'concat_3' type=ConcatV2>,\n",
       " <tf.Operation 'Reshape_1' type=Reshape>,\n",
       " <tf.Operation 'SoftmaxCrossEntropyWithLogits' type=SoftmaxCrossEntropyWithLogits>,\n",
       " <tf.Operation 'Sub_2/y' type=Const>,\n",
       " <tf.Operation 'Sub_2' type=Sub>,\n",
       " <tf.Operation 'Slice_2/begin' type=Const>,\n",
       " <tf.Operation 'Slice_2/size' type=Pack>,\n",
       " <tf.Operation 'Slice_2' type=Slice>,\n",
       " <tf.Operation 'Reshape_2' type=Reshape>,\n",
       " <tf.Operation 'loss_per_px' type=Identity>,\n",
       " <tf.Operation 'mask_per_px' type=Identity>,\n",
       " <tf.Operation 'boolean_mask/Shape' type=Shape>,\n",
       " <tf.Operation 'boolean_mask/strided_slice/stack' type=Const>,\n",
       " <tf.Operation 'boolean_mask/strided_slice/stack_1' type=Const>,\n",
       " <tf.Operation 'boolean_mask/strided_slice/stack_2' type=Const>,\n",
       " <tf.Operation 'boolean_mask/strided_slice' type=StridedSlice>,\n",
       " <tf.Operation 'boolean_mask/Prod/reduction_indices' type=Const>,\n",
       " <tf.Operation 'boolean_mask/Prod' type=Prod>,\n",
       " <tf.Operation 'boolean_mask/Shape_1' type=Shape>,\n",
       " <tf.Operation 'boolean_mask/strided_slice_1/stack' type=Const>,\n",
       " <tf.Operation 'boolean_mask/strided_slice_1/stack_1' type=Const>,\n",
       " <tf.Operation 'boolean_mask/strided_slice_1/stack_2' type=Const>,\n",
       " <tf.Operation 'boolean_mask/strided_slice_1' type=StridedSlice>,\n",
       " <tf.Operation 'boolean_mask/concat/values_0' type=Pack>,\n",
       " <tf.Operation 'boolean_mask/concat/axis' type=Const>,\n",
       " <tf.Operation 'boolean_mask/concat' type=ConcatV2>,\n",
       " <tf.Operation 'boolean_mask/Reshape' type=Reshape>,\n",
       " <tf.Operation 'boolean_mask/Reshape_1/shape' type=Const>,\n",
       " <tf.Operation 'boolean_mask/Reshape_1' type=Reshape>,\n",
       " <tf.Operation 'boolean_mask/Where' type=Where>,\n",
       " <tf.Operation 'boolean_mask/Squeeze' type=Squeeze>,\n",
       " <tf.Operation 'boolean_mask/Gather' type=Gather>,\n",
       " <tf.Operation 'Const_3' type=Const>,\n",
       " <tf.Operation 'loss' type=Mean>,\n",
       " <tf.Operation 'global_step/initial_value' type=Const>,\n",
       " <tf.Operation 'global_step' type=VariableV2>,\n",
       " <tf.Operation 'global_step/Assign' type=Assign>,\n",
       " <tf.Operation 'global_step/read' type=Identity>,\n",
       " <tf.Operation 'samples_seen/initial_value' type=Const>,\n",
       " <tf.Operation 'samples_seen' type=VariableV2>,\n",
       " <tf.Operation 'samples_seen/Assign' type=Assign>,\n",
       " <tf.Operation 'samples_seen/read' type=Identity>,\n",
       " <tf.Operation 'Shape_3' type=Shape>,\n",
       " <tf.Operation 'strided_slice_3/stack' type=Const>,\n",
       " <tf.Operation 'strided_slice_3/stack_1' type=Const>,\n",
       " <tf.Operation 'strided_slice_3/stack_2' type=Const>,\n",
       " <tf.Operation 'strided_slice_3' type=StridedSlice>,\n",
       " <tf.Operation 'add' type=Add>,\n",
       " <tf.Operation 'Assign' type=Assign>,\n",
       " <tf.Operation 'learning_rate/input' type=Const>,\n",
       " <tf.Operation 'learning_rate' type=PlaceholderWithDefault>,\n",
       " <tf.Operation 'beta1/input' type=Const>,\n",
       " <tf.Operation 'beta1' type=PlaceholderWithDefault>,\n",
       " <tf.Operation 'beta2/input' type=Const>,\n",
       " <tf.Operation 'beta2' type=PlaceholderWithDefault>,\n",
       " <tf.Operation 'gradients/Shape' type=Const>,\n",
       " <tf.Operation 'gradients/Const' type=Const>,\n",
       " <tf.Operation 'gradients/Fill' type=Fill>,\n",
       " <tf.Operation 'gradients/f_count' type=Const>,\n",
       " <tf.Operation 'gradients/f_count_1' type=Enter>,\n",
       " <tf.Operation 'gradients/Merge' type=Merge>,\n",
       " <tf.Operation 'gradients/Switch' type=Switch>,\n",
       " <tf.Operation 'gradients/Add/y' type=Const>,\n",
       " <tf.Operation 'gradients/Add' type=Add>,\n",
       " <tf.Operation 'gradients/NextIteration' type=NextIteration>,\n",
       " <tf.Operation 'gradients/f_count_2' type=Exit>,\n",
       " <tf.Operation 'gradients/b_count' type=Const>,\n",
       " <tf.Operation 'gradients/b_count_1' type=Enter>,\n",
       " <tf.Operation 'gradients/Merge_1' type=Merge>,\n",
       " <tf.Operation 'gradients/GreaterEqual/Enter' type=Enter>,\n",
       " <tf.Operation 'gradients/GreaterEqual' type=GreaterEqual>,\n",
       " <tf.Operation 'gradients/b_count_2' type=LoopCond>,\n",
       " <tf.Operation 'gradients/Switch_1' type=Switch>,\n",
       " <tf.Operation 'gradients/Sub' type=Sub>,\n",
       " <tf.Operation 'gradients/NextIteration_1' type=NextIteration>,\n",
       " <tf.Operation 'gradients/b_count_3' type=Exit>,\n",
       " <tf.Operation 'gradients/f_count_3' type=Const>,\n",
       " <tf.Operation 'gradients/f_count_4' type=Enter>,\n",
       " <tf.Operation 'gradients/Merge_2' type=Merge>,\n",
       " <tf.Operation 'gradients/Switch_2' type=Switch>,\n",
       " ...]"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "sess.graph.get_operations()\n",
    "# tf.trainable_variables()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Retrieve operations from the graph"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "def get_op(name):\n",
    "    return tf.get_default_graph().get_operation_by_name(name).outputs[0]\n",
    "\n",
    "## get variables from tf.default_graph\n",
    "iterator_handle_op = get_op(\"data_iterator_handle\")\n",
    "is_train_op = get_op(\"is_train\")\n",
    "global_step_op = get_op(\"global_step\")\n",
    "train_op = get_op(\"train_op\")\n",
    "\n",
    "# container to store operations to be obtained\n",
    "query_map=dict()\n",
    "\n",
    "#atrousdeep generation\n",
    "query_map[\"x\"]=\"input/reshaped/x\"\n",
    "\n",
    "query_map[\"convrnn_input\"]=\"convrnn1/input\"\n",
    "query_map[\"convrnn_output\"]=\"convrnn1/outputs\"\n",
    "query_map[\"convrnn_state\"]=\"convrnn1/final_states\"\n",
    "    \n",
    "query_map[\"targets\"]=\"targets\"\n",
    "query_map[\"predictions\"]=\"predictions\"\n",
    "query_map[\"prediction_scores\"]=\"prediction_scores\"\n",
    "query_map[\"correctly_predicted\"]=\"correctly_predicted\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Inference - Execute the graph with data and store results in dict"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "feed = {iterator_handle_op:data_handle,is_train_op:False}\n",
    "\n",
    "operations = ops = [get_op(query_map[key]) for key in sorted(query_map.keys())]\n",
    "\n",
    "# run a network session with the operations defined prviously\n",
    "queried = sess.run(operations,feed_dict=feed)\n",
    "\n",
    "# build a results dict\n",
    "results=dict()\n",
    "for key, array in zip(sorted(query_map.keys()),queried):\n",
    "    results[key]=array"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "['convrnn_input', 'predictions', 'convrnn_output', 'x', 'correctly_predicted', 'targets', 'prediction_scores', 'convrnn_state']\n"
     ]
    }
   ],
   "source": [
    "print(results.keys())"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Visualize Results\n",
    "\n",
    "### Input"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "473a6a4d5b1444f3a0ddbf02351b8e76",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "A Jupyter Widget"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "fbda43f1195345a7a54013e44b2dc43a",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "A Jupyter Widget"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "show_rgb(results[\"x\"], name=\"x\")\n",
    "show_gray(results[\"targets\"],name=\"labels\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Sequence encoder input and output"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "8d09efc93de64e0c8ebeab497b59dfd3",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "A Jupyter Widget"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "943a406aff324e5098ae740dfefcc32d",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "A Jupyter Widget"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "show(results[\"convrnn_input\"],name=\"convrnn_in\")\n",
    "show(results[\"convrnn_state\"],name=\"states\")\n",
    "\n",
    "if outfolder is not None:\n",
    "    dump3(array=results[\"convrnn_state\"], name=\"final_state\", outfolder=outfolder, cmap=\"inferno\")\n",
    "    dump3(array=results[\"prediction_scores\"], name=\"prediction_scores\", outfolder=outfolder, cmap=\"inferno\")\n",
    "#dump(array=results[\"convrnn_state\"], name=\"final_state\", outfolder=outfolder, cmap=\"inferno\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Activations for each class (aka band)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "fd579eaeafbf49f6a42743d4701e5dce",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "A Jupyter Widget"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "show_gray(results[\"prediction_scores\"],name=\"prediction scores\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Predictions vs Ground truth"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "4f95113fa5b840ba86e452e2b74402fa",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "A Jupyter Widget"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "1b6a1429d8244a82acd2ef599f8d7f97",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "A Jupyter Widget"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "show_gray(results[\"predictions\"],name=\"predictions\",vmin=0,vmax=26)\n",
    "show_gray(results[\"targets\"],name=\"labels\",vmin=0,vmax=26)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Recreate LSTM iteration to access gate activations\n",
    "\n",
    "also implemented in activations.py\n",
    "\n",
    "try:\n",
    "```\n",
    "python activations.py --help\n",
    "```\n",
    "for more info\n",
    "\n",
    "### Define the LSTM cell\n",
    "see implementation in ```utils/convrnn/cell.py```"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [],
   "source": [
    "import utils.convrnn as convrnn\n",
    "import numpy as np\n",
    "\n",
    "b,t,px,px,d_in = results[\"convrnn_input\"].shape\n",
    "\n",
    "def convolution(inputs,W,data_format):\n",
    "    \"\"\"wrapper around tf.nn.convolution with custom padding\"\"\"\n",
    "    pad_h = int(W.get_shape()[0])/2\n",
    "    pad_w = int(W.get_shape()[1])/2\n",
    "\n",
    "    paddings = tf.constant([[0, 0], [pad_h,pad_h], [pad_w,pad_w], [0, 0]])\n",
    "\n",
    "    inputs_padded = tf.pad(inputs, paddings, \"REFLECT\")\n",
    "\n",
    "    return tf.nn.convolution(inputs_padded, W, 'VALID', data_format=data_format)\n",
    "\n",
    "def layer_norm(inputs,beta,gamma):\n",
    "    \"\"\"taken from contrib tf.contrib.layers.layer_norm definition in\n",
    "    tensorflow/contrib/layers/python/layers/layers.py\n",
    "    \"\"\"\n",
    "    mean, variance = tf.nn.moments(inputs, [1,2,3], keep_dims=True)\n",
    "    outputs = tf.nn.batch_normalization(\n",
    "        inputs, mean, variance, offset=beta, scale=gamma,\n",
    "        variance_epsilon=1e-12)\n",
    "    return outputs\n",
    "\n",
    "x = results[\"convrnn_input\"][:,0]\n",
    "\n",
    "scope = \"convrnn1/bidirectional_rnn/fw/conv_lstm_cell\"\n",
    "\n",
    "\n",
    "#state = sess.run(zero_state_op)\n",
    "\n",
    "weights=[]\n",
    "weights.append(get_op(scope+\"/kernel\"))\n",
    "#weights.append(get_op(scope+\"/W_ci\")) # peephole\n",
    "#weights.append(get_op(scope+\"/W_cf\")) # peephole\n",
    "#weights.append(get_op(scope+\"/W_co\")) # peephole\n",
    "weights.append(get_op(scope+\"/LayerNorm/beta\"))\n",
    "weights.append(get_op(scope+\"/LayerNorm/gamma\"))\n",
    "weights.append(get_op(scope+\"/LayerNorm_1/beta\"))\n",
    "weights.append(get_op(scope+\"/LayerNorm_1/gamma\"))\n",
    "weights.append(get_op(scope+\"/LayerNorm_2/beta\"))\n",
    "weights.append(get_op(scope+\"/LayerNorm_2/gamma\"))\n",
    "weights.append(get_op(scope+\"/LayerNorm_3/beta\"))\n",
    "weights.append(get_op(scope+\"/LayerNorm_3/gamma\"))\n",
    "weights.append(get_op(scope+\"/LayerNorm_4/beta\"))\n",
    "weights.append(get_op(scope+\"/LayerNorm_4/gamma\"))\n",
    "\n",
    "def lstm(x,state,weights, peephole=False, activation=tf.nn.tanh):\n",
    "    \"\"\"Implementation modified from carlthome/tensorflow-convlstm-cell\"\"\"\n",
    "\n",
    "    if peephole:\n",
    "        kernel, W_ci, W_cf, W_co, b_j, g_j, b_i, g_i, b_f, g_f, b_o, g_o, b_c, g_c = weights\n",
    "    if not peephole:\n",
    "        kernel, b_j, g_j, b_i, g_i, b_f, g_f, b_o, g_o, b_c, g_c = weights\n",
    "    \n",
    "    \n",
    "    c,h = state\n",
    "    x = tf.concat([x, h], axis=3).eval()\n",
    "    n = x.shape[-1]\n",
    "    m = 4 * convfilters if convfilters > 1 else 4\n",
    "    y = convolution(x,kernel,data_format=\"NHWC\").eval()\n",
    "    #y = tf.nn.convolution(x, kernel, 'SAME', data_format=\"NHWC\").eval()\n",
    "    j, i, f, o = tf.split(y, 4, axis=3)\n",
    "\n",
    "    if peephole:\n",
    "        # peephole connections\n",
    "        i += W_ci * c\n",
    "        f += W_cf * c\n",
    "\n",
    "    # normalize\n",
    "    # replacement for tf.contrib.layers.layer_norm(j)\n",
    "    #\n",
    "    ## normalize in cell.py\n",
    "    #j = tf.contrib.layers.layer_norm(j)\n",
    "    #i = tf.contrib.layers.layer_norm(i)\n",
    "    #f = tf.contrib.layers.layer_norm(f)\n",
    "    #\n",
    "    j = layer_norm(j,b_j,g_j)\n",
    "\n",
    "    i = layer_norm(i,b_i,g_i)\n",
    "\n",
    "    f = layer_norm(f,b_f,g_f)\n",
    "\n",
    "    forget_bias=1\n",
    "    f = tf.sigmoid(f + forget_bias)\n",
    "    i = tf.sigmoid(i)\n",
    "    c = c * f + i * activation(j)\n",
    "    \n",
    "    if peephole:\n",
    "        o += W_co * c\n",
    "\n",
    "    o = layer_norm(o,b_o,g_o)\n",
    "\n",
    "    c = layer_norm(c,b_c,g_c)\n",
    "\n",
    "    o = tf.sigmoid(o)\n",
    "    h = o * activation(c)\n",
    "\n",
    "    state = tf.nn.rnn_cell.LSTMStateTuple(c, h)\n",
    "\n",
    "    return h,state,j,i,f,o\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(2, 46, 48, 48, 512)"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "results[\"convrnn_output\"].shape"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Perform Iteration on CPU"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "time 0\n",
      "time 1\n",
      "time 2\n",
      "time 3\n",
      "time 4\n",
      "time 5\n",
      "time 6\n",
      "time 7\n",
      "time 8\n",
      "time 9\n",
      "time 10\n",
      "time 11\n",
      "time 12\n",
      "time 13\n",
      "time 14\n",
      "time 15\n",
      "time 16\n",
      "time 17\n",
      "time 18\n",
      "time 19\n",
      "time 20\n",
      "time 21\n",
      "time 22\n",
      "time 23\n",
      "time 24\n",
      "time 25\n",
      "time 26\n",
      "time 27\n",
      "time 28\n",
      "time 29\n",
      "time 30\n",
      "time 31\n",
      "time 32\n",
      "time 33\n",
      "time 34\n",
      "time 35\n",
      "time 36\n",
      "time 37\n",
      "time 38\n",
      "time 39\n",
      "time 40\n",
      "time 41\n",
      "time 42\n",
      "time 43\n",
      "time 44\n",
      "time 45\n"
     ]
    }
   ],
   "source": [
    "inputs = results[\"convrnn_input\"]\n",
    "\n",
    "b,t,px,px,d = results[\"convrnn_output\"].shape\n",
    "convfilters = d/2\n",
    "zero_state_op = tf.contrib.rnn.LSTMStateTuple(c=tf.zeros(tf.TensorShape([b, px, px, convfilters])),h=tf.zeros(tf.TensorShape([b, px, px, convfilters])))\n",
    "state=sess.run(zero_state_op)\n",
    "\n",
    "jGate = []\n",
    "iGate = []\n",
    "fGate = []\n",
    "oGate = []\n",
    "outputs = []\n",
    "states = []\n",
    "statesh = []\n",
    "\n",
    "# execute on cpu because ressource exhausted error on GPU\n",
    "with tf.device('/cpu:0'):\n",
    "\n",
    "    for time in range(0,t):\n",
    "        print(\"time {}\".format(time))\n",
    "\n",
    "        h,state,j,i,f,o = lstm(inputs[:,time],state, weights)\n",
    "        state = tf.contrib.rnn.LSTMStateTuple(c=state.c.eval(),h=state.h.eval())\n",
    "\n",
    "        #show_gray(i.eval(),\"input_gate at t{}\".format(it))\n",
    "\n",
    "        iGate.append(i.eval())\n",
    "        jGate.append(j.eval())\n",
    "        fGate.append(f.eval())\n",
    "        oGate.append(o.eval())\n",
    "        outputs.append(h.eval())\n",
    "        states.append(state.c)\n",
    "        statesh.append(state.h)\n",
    "\n",
    "iGate = np.stack(iGate,axis=1)\n",
    "jGate = np.stack(jGate,axis=1)\n",
    "fGate = np.stack(fGate,axis=1)\n",
    "oGate = np.stack(oGate,axis=1)\n",
    "outputs = np.stack(outputs,axis=1)\n",
    "states = np.stack(np.array(states),axis=1)\n",
    "statesh = np.stack(np.array(statesh),axis=1)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Show Results"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "c4abc1245ca54b96aa8b9c873ad1fa63",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "A Jupyter Widget"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "cbaac19e4ce9480aba7e32f2d3672bee",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "A Jupyter Widget"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "b911cf60def642cf94b302f095268aaf",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "A Jupyter Widget"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "f6783375c8814ec4835ea484b708b180",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "A Jupyter Widget"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "import matplotlib.pyplot as plt\n",
    "from ipywidgets import interact, interactive, fixed, interact_manual\n",
    "import ipywidgets as widgets\n",
    "import numpy as np\n",
    "\n",
    "def show_activations(arrays_tuple, titles=[\"\"]):\n",
    "    \n",
    "    max_b, max_t,_,_,max_d = arrays_tuple[1].shape\n",
    "    max_d=10\n",
    "        \n",
    "    def _show_map_BTHWD(t,d,b): \n",
    "        n = len(arrays_tuple)\n",
    "        \n",
    "        fig,axs = plt.subplots(1,n,figsize=(16,6))\n",
    "        \n",
    "        for array,ax,title in zip(arrays_tuple,axs,titles): \n",
    "            ax.imshow(array[b,t,:,:,d-1:d+2])\n",
    "            ax.set_title(title)\n",
    "            #_show(array[b,t,:,:,d],\"{name} feature map b={b}, t={t}, d={d}\".format(name=name,b=b,t=t,d=d))\n",
    "    \n",
    "    # all\n",
    "    b_slider = widgets.IntSlider(description='batch',min=0,max=max_b-1,step=1,value=max_b/2)\n",
    "         \n",
    "    d_slider = widgets.IntSlider(description='band',min=1,max=max_d-1,step=1,value=max_d/2) \n",
    "    t_slider = widgets.IntSlider(description='time',min=0,max=max_t-1,step=1,value=max_t/2)\n",
    "    w = interactive(_show_map_BTHWD, t=t_slider, d=d_slider, b=b_slider)\n",
    "    \n",
    "    w.layout.height = '400px'\n",
    "    display(w)\n",
    "   \n",
    "#show(,\"x\")\n",
    "def norm(arr,thresmin=-1,thresmax=1):\n",
    "    arr[arr<thresmin]=thresmin\n",
    "    arr[arr>thresmax]=thresmax\n",
    "    return ( (arr-arr.min()) / (arr-arr.min()).max()).astype('float')\n",
    "\n",
    "show_activations([iGate,oGate,norm(jGate),fGate,norm(states),norm(statesh),norm(outputs)],titles=[\"i\",\"o\",\"j\",\"f\",\"state\",\"stateh\",\"output\"])\n",
    "show(results[\"x\"])\n",
    "show_gray(states)\n",
    "show_gray(statesh)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "3b47333738ce4c78afaa57fc1802b867",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "A Jupyter Widget"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "2e7f3f8d04f14763b523cf5808d74b8d",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "A Jupyter Widget"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "7ce7706bc0204d65b77ac2e02d90c951",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "A Jupyter Widget"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "ec645c87f1464ea5a150096b5dafb044",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "A Jupyter Widget"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "show_rgb(results[\"x\"], name=\"x\")\n",
    "show_gray(iGate,\"input\")\n",
    "show_gray(fGate,\"forget\")\n",
    "show_gray(states,\"states\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Write Arrays to png files\n",
    "\n",
    "folder structure\n",
    "``\n",
    "{outfolder}/sample{s}/time{t}/{d}_{name}.png\n",
    "``\n",
    "\n",
    "with `s` as sample in batch, `t` as time, `d` as number of feature map and `name` `iGate`,`jGate`,`oGate`, etc."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "if outfolder is not None:\n",
    "\n",
    "    cmap=\"inferno\"\n",
    "\n",
    "    dump_rgb(results[\"x\"][:,:,:,:,0:3],\"x\",outfolder,stddev=4)\n",
    "\n",
    "    dump(array=iGate, name=\"iGate\", outfolder=outfolder, cmap=\"inferno\")\n",
    "    dump(array=fGate, name=\"fGate\", outfolder=outfolder, cmap=\"inferno\")\n",
    "    dump(array=oGate, name=\"oGate\", outfolder=outfolder, cmap=\"inferno\")\n",
    "    dump(array=(jGate/2)+0.5, name=\"jGate\", outfolder=outfolder, cmap=\"RdBu_r\")\n",
    "    dump(array=(statesh/2)+0.5, name=\"output\", outfolder=outfolder, cmap=\"RdBu_r\")\n",
    "    dump(array=(states/2)+0.5, name=\"state\", outfolder=outfolder, cmap=\"RdBu_r\")\n",
    "\n",
    "    dump_class(results[\"targets\"],\"ground_truth\",outfolder)\n",
    "    dump_class(results[\"predictions\"],\"predictions\",outfolder)\n",
    "    for i in range(0,17):\n",
    "        dump_class(results[\"prediction_scores\"][:,:,:,i],\"prediction_scores_\"+str(i),outfolder)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(2, 48, 48, 17)"
      ]
     },
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "results[\"prediction_scores\"].shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAA5cAAAD7CAYAAAD+S2BZAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4wLCBo\ndHRwOi8vbWF0cGxvdGxpYi5vcmcvpW3flQAAB1JJREFUeJzt2cFu2zgUQFFT7Xzl/P9vVLPoohJl\nskYuBkWBc1ZpSD1RjmHkNuM8zxcAAAAUx58+AAAAAH8/cQkAAEAmLgEAAMjEJQAAAJm4BAAAIBOX\nAAAAZOISAACATFwCAACQiUsAAAAycQkAAED2/U8f4CvG+H5e/jWtHpeVy9qYO/q679t0g+va5evd\njLGed1ubZqzmzzOO5Zmme13Wjs3a9V7HfN7X+7Ux/V/Edf5jbfH6Hud63/2azb7NjLGY9/O6sbjm\n/h46XuPt17vrnvte7/eN9b0e7+RxnX+Z95jx/prnvPdnmtfu9/psxjHv+3jG++/v1j7dt53xOu/7\nFvN3r+H8aTDG+Xbt+fy/9u3Ofj3jY8YH951n7vbtZ6zOO7+Gq+e/77u/X7864/1rM8+775vWxmLG\n471xOdPttfhs3nPt+ozre63u+9W1+bzLfbt5x7z247dn383/P+41jg/vdfyat3sNV/PmM712+7Zr\ni+d6PP/l39drNvuus39+Y/Fc04zXWMzf/UzmGcfiHJvXZvdct+vmcxzvfw7zh9lYzVj/arf71fE3\nH/TXr68fMNPAr6w99i0OvNu3WTuPbx/te132nR/ue+y93Wve9/4c57Tvfo4P18Y9f+73uqw9zvTh\n2nX+MaXWct8/y31jOu/1urHZNz7cd1z3jbk/fq19G//Ovxa95S+XAAAAZOISAACATFwCAACQiUsA\nAAAycQkAAEAmLgEAAMjEJQAAAJm4BAAAIBOXAAAAZOISAACATFwCAACQiUsAAAAycQkAAEAmLgEA\nAMjEJQAAAJm4BAAAIBOXAAAAZOISAACATFwCAACQiUsAAAAycQkAAEAmLgEAAMjEJQAAAJm4BAAA\nIBOXAAAAZOISAACATFwCAACQiUsAAAAycQkAAEAmLgEAAMjEJQAAAJm4BAAAIBOXAAAAZOISAACA\nTFwCAACQiUsAAAAycQkAAEAmLgEAAMjEJQAAAJm4BAAAIBOXAAAAZOISAACATFwCAACQiUsAAAAy\ncQkAAEAmLgEAAMjEJQAAAJm4BAAAIBOXAAAAZOISAACATFwCAACQiUsAAAAycQkAAEAmLgEAAMjE\nJQAAAJm4BAAAIBOXAAAAZOISAACATFwCAACQiUsAAAAycQkAAEAmLgEAAMjEJQAAAJm4BAAAIBOX\nAAAAZOISAACATFwCAACQiUsAAAAycQkAAEAmLgEAAMjEJQAAAJm4BAAAIBOXAAAAZOISAACATFwC\nAACQiUsAAAAycQkAAEAmLgEAAMjEJQAAAJm4BAAAIBOXAAAAZOISAACATFwCAACQiUsAAAAycQkA\nAEAmLgEAAMjEJQAAAJm4BAAAIBOXAAAAZOISAACATFwCAACQiUsAAAAycQkAAEAmLgEAAMjEJQAA\nAJm4BAAAIBOXAAAAZOISAACATFwCAACQiUsAAAAycQkAAEAmLgEAAMjEJQAAAJm4BAAAIBOXAAAA\nZOISAACATFwCAACQiUsAAAAycQkAAEAmLgEAAMjEJQAAAJm4BAAAIBOXAAAAZOISAACATFwCAACQ\niUsAAAAycQkAAEAmLgEAAMjEJQAAAJm4BAAAIBOXAAAAZOISAACATFwCAACQiUsAAAAycQkAAEAm\nLgEAAMjEJQAAAJm4BAAAIBOXAAAAZOISAACATFwCAACQiUsAAAAycQkAAEAmLgEAAMjEJQAAAJm4\nBAAAIBOXAAAAZOISAACATFwCAACQiUsAAAAycQkAAEAmLgEAAMjEJQAAAJm4BAAAIBOXAAAAZOIS\nAACATFwCAACQiUsAAAAycQkAAEAmLgEAAMjEJQAAAJm4BAAAIBOXAAAAZOISAACATFwCAACQiUsA\nAAAycQkAAEAmLgEAAMjEJQAAAJm4BAAAIBOXAAAAZOISAACATFwCAACQiUsAAAAycQkAAEAmLgEA\nAMjEJQAAAJm4BAAAIBOXAAAAZOISAACATFwCAACQiUsAAAAycQkAAEAmLgEAAMjEJQAAAJm4BAAA\nIBOXAAAAZOISAACATFwCAACQiUsAAAAycQkAAEAmLgEAAMjEJQAAAJm4BAAAIBOXAAAAZOISAACA\nTFwCAACQiUsAAAAycQkAAEAmLgEAAMjEJQAAAJm4BAAAIBOXAAAAZOISAACATFwCAACQiUsAAAAy\ncQkAAEAmLgEAAMjEJQAAAJm4BAAAIBOXAAAAZOISAACATFwCAACQiUsAAAAycQkAAEAmLgEAAMjE\nJQAAAJm4BAAAIBOXAAAAZOISAACATFwCAACQiUsAAAAycQkAAEAmLgEAAMjEJQAAANk4z/NPnwEA\nAIC/nL9cAgAAkIlLAAAAMnEJAABAJi4BAADIxCUAAACZuAQAACATlwAAAGTiEgAAgExcAgAAkIlL\nAAAAMnEJAABAJi4BAADIxCUAAACZuAQAACATlwAAAGTiEgAAgExcAgAAkIlLAAAAMnEJAABAJi4B\nAADIxCUAAACZuAQAACATlwAAAGT/AbEKdPEXq8B6AAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x7f6bb4720690>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAA5cAAAD7CAYAAAD+S2BZAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4wLCBo\ndHRwOi8vbWF0cGxvdGxpYi5vcmcvpW3flQAABz9JREFUeJzt2UGO2zYAQNGx3IP0eD1Vr9T7FB2p\nq8AUZake/6CDAO+tZJMiKcEJ8DG3bds+AAAAoFi++wAAAAD8+sQlAAAAmbgEAAAgE5cAAABk4hIA\nAIBMXAIAAJCJSwAAADJxCQAAQCYuAQAAyMQlAAAA2W/ffYB3/HH7fftxPdfx/TZe355+/+7Y+P3/\nvdf4nO+c6SvnXZbHF8v9sfNtmng7mTfPXYbreY3d+suL8w5jw33L1bznY8v8XCfrHfYa1rtaY/+M\n83tanl7Pc/d7vTbvsN7FOfbv5v7l8y5fea6Tc8zzzt7bcb3HeT+W+27sY7xv6fN27+M+rzG+t3GN\npc+72Ov07G/Om/faxv9Hbsvz6+nz9uK8eex0r/nd/IS99muc7Htxju3dvYav120/7Wxs2/YT1/Ge\naY11+OJyr20ce37P8RzT2DB7v9681+OL67MPY9NJzs4xn/dzmDg+1+f8DoeDHMZ294337OeN953d\nM9933OtkvfXFedN6++ffn+P0vOt+3tl7+5yff31t7J8X5+2v15fmXa+xn3d2jnef6615h9/h8G9o\nWmP8vJu3vThvXu/i97Wt4/X572s7Wf+w3nZ+jrMzbhe/w7N9j+vtF9nWz/+8nj+vL8477PX59b2u\n5l2e4yfvdT32eM6///pzKobn/OUSAACATFwCAACQiUsAAAAycQkAAEAmLgEAAMjEJQAAAJm4BAAA\nIBOXAAAAZOISAACATFwCAACQiUsAAAAycQkAAEAmLgEAAMjEJQAAAJm4BAAAIBOXAAAAZOISAACA\nTFwCAACQiUsAAAAycQkAAEAmLgEAAMjEJQAAAJm4BAAAIBOXAAAAZOISAACATFwCAACQiUsAAAAy\ncQkAAEAmLgEAAMjEJQAAAJm4BAAAIBOXAAAAZOISAACATFwCAACQiUsAAAAycQkAAEAmLgEAAMjE\nJQAAAJm4BAAAIBOXAAAAZOISAACATFwCAACQiUsAAAAycQkAAEAmLgEAAMjEJQAAAJm4BAAAIBOX\nAAAAZOISAACATFwCAACQiUsAAAAycQkAAEAmLgEAAMjEJQAAAJm4BAAAIBOXAAAAZOISAACATFwC\nAACQiUsAAAAycQkAAEAmLgEAAMjEJQAAAJm4BAAAIBOXAAAAZOISAACATFwCAACQiUsAAAAycQkA\nAEAmLgEAAMjEJQAAAJm4BAAAIBOXAAAAZOISAACATFwCAACQiUsAAAAycQkAAEAmLgEAAMjEJQAA\nAJm4BAAAIBOXAAAAZOISAACATFwCAACQiUsAAAAycQkAAEAmLgEAAMjEJQAAAJm4BAAAIBOXAAAA\nZOISAACATFwCAACQiUsAAAAycQkAAEAmLgEAAMjEJQAAAJm4BAAAIBOXAAAAZOISAACATFwCAACQ\niUsAAAAycQkAAEAmLgEAAMjEJQAAAJm4BAAAIBOXAAAAZOISAACATFwCAACQiUsAAAAycQkAAEAm\nLgEAAMjEJQAAAJm4BAAAIBOXAAAAZOISAACATFwCAACQiUsAAAAycQkAAEAmLgEAAMjEJQAAAJm4\nBAAAIBOXAAAAZOISAACATFwCAACQiUsAAAAycQkAAEAmLgEAAMjEJQAAAJm4BAAAIBOXAAAAZOIS\nAACATFwCAACQiUsAAAAycQkAAEAmLgEAAMjEJQAAAJm4BAAAIBOXAAAAZOISAACATFwCAACQiUsA\nAAAycQkAAEAmLgEAAMjEJQAAAJm4BAAAIBOXAAAAZOISAACATFwCAACQiUsAAAAycQkAAEAmLgEA\nAMjEJQAAAJm4BAAAIBOXAAAAZOISAACATFwCAACQiUsAAAAycQkAAEAmLgEAAMjEJQAAAJm4BAAA\nIBOXAAAAZOISAACATFwCAACQiUsAAAAycQkAAEAmLgEAAMjEJQAAAJm4BAAAIBOXAAAAZOISAACA\nTFwCAACQiUsAAAAycQkAAEAmLgEAAMjEJQAAAJm4BAAAIBOXAAAAZOISAACATFwCAACQiUsAAAAy\ncQkAAEAmLgEAAMjEJQAAAJm4BAAAIBOXAAAAZOISAACATFwCAACQiUsAAAAycQkAAEAmLgEAAMjE\nJQAAAJm4BAAAIBOXAAAAZOISAACATFwCAACQiUsAAAAycQkAAEAmLgEAAMjEJQAAAJm4BAAAIBOX\nAAAAZOISAACATFwCAACQiUsAAAAycQkAAEAmLgEAAMjEJQAAAJm4BAAAIBOXAAAAZOISAACATFwC\nAACQiUsAAAAycQkAAEAmLgEAAMjEJQAAAJm4BAAAILtt2/bdZwAAAOAX5y+XAAAAZOISAACATFwC\nAACQiUsAAAAycQkAAEAmLgEAAMjEJQAAAJm4BAAAIBOXAAAAZOISAACATFwCAACQiUsAAAAycQkA\nAEAmLgEAAMjEJQAAAJm4BAAAIBOXAAAAZOISAACATFwCAACQiUsAAAAycQkAAEAmLgEAAMjEJQAA\nANm/TlZsALNGV/QAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x7f6bb4720850>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAA5cAAAD7CAYAAAD+S2BZAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4wLCBo\ndHRwOi8vbWF0cGxvdGxpYi5vcmcvpW3flQAAB0dJREFUeJzt2UFu3DYAQFFLDnKfXKmn6vF6kRll\nERSmqJEynZ/UCPDeSmNSJCUjNn68bNv2BgAAAMX62QcAAADgzycuAQAAyMQlAAAAmbgEAAAgE5cA\nAABk4hIAAIBMXAIAAJCJSwAAADJxCQAAQCYuAQAAyL589gFe8fXbX9u/18u67+Nlff/p9atjy/v5\nvPW377X+9J5Xz3Gc97HXui7D15dp3sfndZnHHs+b19itP6yxXux1WGN5PLZM/3Vyttflc81jJ2d8\ndo336T29j2Prc2O/Yt6X377XejH2+Bwv7zV+Tw7v9+3h2Px9GJcc15/X282bx06+z9Nx92O7e/bz\nLs97ct/h+Xd7XZx9OX+/46dlt9fbNO/xMy/zc+3WO3+/u73epjOdnGPaav+z4fB+H993+Fm2O8f4\n9YuzH85xMrbd9xPHz8P1Ms+7P553vG97at7p9bz3k+fY7fur9jp9N/u9ttttON/H9TZcH84+je3m\nXs072Wt3z2G983M8Pe9s36uzT3Ofnncbr+fnug+3TGO3+8N5hzVO5l2ud3GO8byHNU7O8eyZ5jWv\n5p2tf73eNo1tw9j94dd/rPnkvOHz8f0Oa9z/+xrz2cczXe21f8b5+cf39ty8+30/Nk69DT8rpiVO\nx27b+XrTv5qX1njlTP/3XuNz/r39M/96e8hfLgEAAMjEJQAAAJm4BAAAIBOXAAAAZOISAACATFwC\nAACQiUsAAAAycQkAAEAmLgEAAMjEJQAAAJm4BAAAIBOXAAAAZOISAACATFwCAACQiUsAAAAycQkA\nAEAmLgEAAMjEJQAAAJm4BAAAIBOXAAAAZOISAACATFwCAACQiUsAAAAycQkAAEAmLgEAAMjEJQAA\nAJm4BAAAIBOXAAAAZOISAACATFwCAACQiUsAAAAycQkAAEAmLgEAAMjEJQAAAJm4BAAAIBOXAAAA\nZOISAACATFwCAACQiUsAAAAycQkAAEAmLgEAAMjEJQAAAJm4BAAAIBOXAAAAZOISAACATFwCAACQ\niUsAAAAycQkAAEAmLgEAAMjEJQAAAJm4BAAAIBOXAAAAZOISAACATFwCAACQiUsAAAAycQkAAEAm\nLgEAAMjEJQAAAJm4BAAAIBOXAAAAZOISAACATFwCAACQiUsAAAAycQkAAEAmLgEAAMjEJQAAAJm4\nBAAAIBOXAAAAZOISAACATFwCAACQiUsAAAAycQkAAEAmLgEAAMjEJQAAAJm4BAAAIBOXAAAAZOIS\nAACATFwCAACQiUsAAAAycQkAAEAmLgEAAMjEJQAAAJm4BAAAIBOXAAAAZOISAACATFwCAACQiUsA\nAAAycQkAAEAmLgEAAMjEJQAAAJm4BAAAIBOXAAAAZOISAACATFwCAACQiUsAAAAycQkAAEAmLgEA\nAMjEJQAAAJm4BAAAIBOXAAAAZOISAACATFwCAACQiUsAAAAycQkAAEAmLgEAAMjEJQAAAJm4BAAA\nIBOXAAAAZOISAACATFwCAACQiUsAAAAycQkAAEAmLgEAAMjEJQAAAJm4BAAAIBOXAAAAZOISAACA\nTFwCAACQiUsAAAAycQkAAEAmLgEAAMjEJQAAAJm4BAAAIBOXAAAAZOISAACATFwCAACQiUsAAAAy\ncQkAAEAmLgEAAMjEJQAAAJm4BAAAIBOXAAAAZOISAACATFwCAACQiUsAAAAycQkAAEAmLgEAAMjE\nJQAAAJm4BAAAIBOXAAAAZOISAACATFwCAACQiUsAAAAycQkAAEAmLgEAAMjEJQAAAJm4BAAAIBOX\nAAAAZOISAACATFwCAACQiUsAAAAycQkAAEAmLgEAAMjEJQAAAJm4BAAAIBOXAAAAZOISAACATFwC\nAACQiUsAAAAycQkAAEAmLgEAAMjEJQAAAJm4BAAAIBOXAAAAZOISAACATFwCAACQiUsAAAAycQkA\nAEAmLgEAAMjEJQAAAJm4BAAAIBOXAAAAZOISAACATFwCAACQiUsAAAAycQkAAEAmLgEAAMjEJQAA\nAJm4BAAAIBOXAAAAZOISAACATFwCAACQiUsAAAAycQkAAEAmLgEAAMjEJQAAAJm4BAAAIBOXAAAA\nZOISAACATFwCAACQiUsAAAAycQkAAEAmLgEAAMjEJQAAAJm4BAAAIBOXAAAAZOISAACATFwCAACQ\niUsAAAAycQkAAEAmLgEAAMjEJQAAAJm4BAAAIBOXAAAAZOISAACATFwCAACQiUsAAAAycQkAAEAm\nLgEAAMjEJQAAAJm4BAAAIBOXAAAAZOISAACATFwCAACQiUsAAACyZdu2zz4DAAAAfzh/uQQAACAT\nlwAAAGTiEgAAgExcAgAAkIlLAAAAMnEJAABAJi4BAADIxCUAAACZuAQAACATlwAAAGTiEgAAgExc\nAgAAkIlLAAAAMnEJAABAJi4BAADIxCUAAACZuAQAACATlwAAAGTiEgAAgExcAgAAkIlLAAAAMnEJ\nAABAJi4BAADIvgNxeVAAQ0iyOwAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x7f6b86bf6650>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "def plot_color_gradients(name, filename=\"tmp/test.png\",w=8,h=2):\n",
    "    fig = plt.figure(frameon=False)\n",
    "    fig.set_size_inches(w,h)\n",
    "    #fig.subplots_adjust(top=0.95, bottom=0.01, left=0.2, right=0.99)\n",
    "\n",
    "    ax = plt.Axes(fig, [0., 0., 1., 1.])\n",
    "    ax.set_axis_off()\n",
    "    fig.add_axes(ax)\n",
    "    \n",
    "    ax.imshow(gradient, aspect='auto', cmap=plt.get_cmap(name))\n",
    "\n",
    "    ax.set_axis_off()\n",
    "        \n",
    "    plt.savefig(filename)\n",
    "\n",
    "gradient = np.linspace(0, 1, 256)\n",
    "gradient = np.vstack((gradient, gradient))\n",
    "\n",
    "if not os.path.exists(\"tmp\"):\n",
    "    os.makedirs(\"tmp\")\n",
    "\n",
    "plot_color_gradients(\"inferno\", w=12,h=3,filename=os.path.join(\"tmp\",\"inferno.png\"))\n",
    "plot_color_gradients(\"RdBu\", w=12,h=3,filename=os.path.join(\"tmp\",\"RdBu.png\"))\n",
    "plot_color_gradients(\"RdBu_r\", w=12,h=3,filename=os.path.join(\"tmp\",\"RdBu_r.png\"))"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python [conda env:MTLCC]",
   "language": "python",
   "name": "conda-env-MTLCC-py"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.14"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
